React Refresh Babel preventing server build

Hi everyone!

Ever since meteor 2.0 I’m getting this error when trying to build meteor on my server. I’ve been looking far and wide for a solution but to no avail.

What I have tried is added a .babelrc file to my project with the following contents but that didn’t help.
{ "plugins": [ ["react-refresh/babel", { skipEnvCheck: true }] ] }

Anyone know why I’m getting this error?

Errors prevented bundling: While building for web.browser: client/main.js: [BABEL] /build/dce66183-d6e6-4294-a1db-179ecb1f2493/client/main.js: React Refresh Babel transform should only be enabled in development environment. Instead, the environment is: "production". If you want to override this check, pass {skipEnvCheck: true} as plugin options. (While processing: "base$0$0")

I’m not using react in my project.
Any help is very much appreciated!


You can disable react fast refresh, though there currently is no way to change its config.

Why is NODE_ENV set to production? Are you running meteor with the --production option or did you manually set the NODE_ENV env var? When react-refresh added the env check, I had tried to find a situation where NODE_ENV could be set to production and HMR is enabled, and was unable to.

That did it, I didn’t know about that flag. Thanks

I get a TypeError: module.export is not a function now but I’ll try and figure that one out for myself.

About the NODE_ENV, I set that myself a while ago. I seem to remember my host didn’t run meteor with the production flag and I had to set it in the ENV variables. Like I said, though, it’s been a while since I set that.

Thanks again!