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
This is being caused by babel-register attempting to compile:
let __RewireAPI__ = {};
My interpretation of this error is that because we have 'use strict' at the top of all modules, the code injected by babel-plugin-rewire (which contains let __RewireAPI__ = {}; somewhere) causes an error when compiled by babel-register because let is not supported in strict mode.
The closest issue that describes something similar is this one: #71 (comment)
As you can tell, I don't have a good eagle-eye view of the whole babel pipeline, so it's hard to reason about what's going wrong at which stage. In my package.json I have:
"babel-plugin-rewire": "^1.0.0"
Perhaps I got an old version from NPM because the package was renamed, and the fix for my issue is in a new version somewhere?
Thank you!
The text was updated successfully, but these errors were encountered:
Adding transform-es2015-block-scoping plug-in before babel-plugin-rewire in .babelrc appears to have fixed this issue. I also added the require for babel-plugin-rewire in our Gruntfile.js to have mocha load the plug-in when running unit tests (otherwise it wasn't able to find the definition for Rewire, etc).
I am getting the following error when running mocha unit tests:
This is being caused by babel-register attempting to compile:
My interpretation of this error is that because we have 'use strict' at the top of all modules, the code injected by
babel-plugin-rewire
(which containslet __RewireAPI__ = {};
somewhere) causes an error when compiled by babel-register becauselet
is not supported in strict mode.The closest issue that describes something similar is this one:
#71 (comment)
Some kind of related commit is here:
ddfea82
As you can tell, I don't have a good eagle-eye view of the whole babel pipeline, so it's hard to reason about what's going wrong at which stage. In my
package.json
I have:"babel-plugin-rewire": "^1.0.0"
Perhaps I got an old version from NPM because the package was renamed, and the fix for my issue is in a new version somewhere?
Thank you!
The text was updated successfully, but these errors were encountered: