You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dotenv-expand breaking build when "$" is used #3961
We use variables that include $ within the strings, which we don't want to be expanded. Escaping with \$ works fine when it occurs at the start of the string, but not anywhere else within the string.
Example:
REACT_APP_MYVAR=\$bar.baz <- works as expected, value is "$bar.baz" REACT_APP_MYVAR=foo\$bar.baz <- I'd expect "foo$bar.baz" but I get "foo\.baz"
Only expand when the variable starts with $ (instead of when it doesn't start with \$). This would make it impossible to expand variables inside a string which is maybe okay.
Check if each occurrence of $ in the string is escaped and only expand it if it's not
Activity
gaearon commentedon Feb 2, 2018
This sounds really annoying. Sorry.
Do you want to look into what's causing this?
iansu commentedon Feb 2, 2018
This does appear to be a bug in
dotenv-expand. It only looks for an escaped$at the start of the string.jdcrensh commentedon Feb 2, 2018
Right, it looks like this is the problem: https://github.com/motdotla/dotenv-expand/blob/master/lib/main.js#L25
iansu commentedon Feb 2, 2018
Yes. I think there a couple of ways to fix it:
$(instead of when it doesn't start with\$). This would make it impossible to expand variables inside a string which is maybe okay.$in the string is escaped and only expand it if it's notgaearon commentedon Feb 2, 2018
This makes sense to me. We should also document that behavior.
Upgrade dotenv-expand to 4.2.0 (react#3961)
Upgrade dotenv-expand to 4.2.0 (#3961) (#3992)
gaearon commentedon Feb 9, 2018
Fixed in
react-scripts@1.1.1.Revert "Upgrade dotenv-expand to 4.2.0 (react#3961) (react#3992)"
Upgrade dotenv-expand to 4.2.0 (react#3961) (react#3992)
Upgrade dotenv-expand to 4.2.0 (react#3961) (react#3992)