I am using babel-cli for jsx and es6 features to transpile
i have changed my build command
from
"build": "node build",
to
"build": "babel-node build",
Everything was working fine before
But when i run the build command i get this error
Error: locals[0] does not appear to be a module object with Hot Module replacement API enabled. You should disable react-transform-hmr in production by using env section in Babel configuration. See the example in README: https://github.com/gaearon/react-transform-hmr
See the screenshot also

So i should disable react-transform-hmr in production by using env section in Babel configuration
and this is my .babelrc like the instructions
{
"presets": ["react", "es2015"],
"env": {
"development": {
"plugins": [
["transform-object-rest-spread"],
["transform-react-display-name"],
["react-transform", {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"]
}, {
"transform": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}]
}]
]
},
"production": {
"plugins": [
["transform-object-rest-spread"],
["transform-react-display-name"]
]
}
}
}
what am i doing wrong? Any recommendation?
I had to add NODE_ENV=production to the command
"build": "NODE_ENV=production babel-node build"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With