Hi! I'm trying to configure some vars into my ENVIRONMENT files but it's trow a console error.
Here is my configuration:
/config/dev.env.js:
var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
API_BASE_URL: '"foo"'
})
/src/main.js
...
console.log(process.env.API_BASE_URL)
Console display this error:
Uncaught SyntaxError: missing ) after argument list
at Object.<anonymous> (app.js:1093)
at __webpack_require__ (app.js:660)
at fn (app.js:86)
at Object.<anonymous> (app.js:1779)
at __webpack_require__ (app.js:660)
at app.js:709
at app.js:712
If I invert the order of attributes that works!
module.exports = merge(prodEnv, {
API_BASE_URL: '"foo"',
NODE_ENV: '"development"'
})
I can't reproduce this, sorry :/
Hi! Probably it was a isolated error... I don't know why but after that, every config that I used simply worked... Can you close this issue? Thanks!
Exactly same issue here. Can't use any customized property in *.env.js`.
e.g. in dev.env.js:
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
ROOT_API: '"http://127.0.0.1:5000/"'
})
Then, console.log(process.env.ROOT_API) will just give me the same error: "SyntaxError: missing } after property list".
But console.log(process.env.NODE_ENV) works well
All components are at their latest version - weback 4, vue 2, etc
@luismiguelprs Could you please share your solution to this issue if you found any ...? Thanks!
Just figured out - we need to stop the current process and do a rebuild in order to make the change work. For me, I just ctrl+C and npm run dev. Sorry for any disturbance
Same issue, here, but figured out,
You need to be very careful, with quotes
VALUE:'"value"' needs to be in double quote
if you use variable you need to do like this
VAR:'"'+myvar+'"'
Most helpful comment
Same issue, here, but figured out,
You need to be very careful, with quotes
VALUE:'"value"'needs to be in double quoteif you use variable you need to do like this
VAR:'"'+myvar+'"'