@ffxsam I was actually planning to open an issue for this and provide the steps for how I resolved it. The solution I used to get it to work is likely not ideal as I was unable to determine the exact change that caused the issue. My solution may not work for you, but I would be interested to hear your results.
Also out of curiosity what version of babel-preset-meteor are you using?
Starting on Meteor v1.4.3.2 before the upgrade we had the below file.
.babelrc
{
"presets": ["meteor", "env", "react", "stage-2"],
"plugins": ["transform-es2015-modules-commonjs"]
}
After updating to Meteor v1.4.4.1 the app would build/load but would report the below on client load.
Uncaught ReferenceError: React is not defined
at index.js:13
at maybeReady (meteor.js?hash=27829e9…:809)
at HTMLDocument.loadingCompleted (meteor.js?hash=27829e9…:821)
The import that caused the ReferenceError was import React from 'react';
which was working fine on Meteor v1.4.3.2.
To debug I looked at the transpiled code, then cleaned my meteor cache to do a rebuild, next I also tried removing all node_modules and reinstalling the npm packages. This didn’t fix the issue. I suspected the issue was related to a change with babel and transpiling.
I was able to fix the issue for Meteor v1.4.4.1 with the below.
meteor npm install --save-dev babel-plugin-transform-es2015-modules-reify
Updating my .babelrc to use reify directly.
{
"presets": ["meteor", "env", "react", "stage-2"],
"plugins": ["transform-es2015-modules-reify"]
}
The above step broke our mocha
tests we were using. To resolve that issue we installed reify directly as a dependency meteor npm install --save reify
and passed reify as an option to mocha’s --compiler command.
Let me know if any of the above helps you!
Update: Forgot to mention to be on the safe side you should run meteor reset
as I was experiencing some issues with the builds. I imagine some files were cached. It may also help to clean your node_modules
and complete a fresh install if the above steps don’t help solve the issue for you.