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
/home/runner/work/amplify-ui/amplify-ui/node_modules/react-native-url-polyfill/auto.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import {setupURLPolyfill} from './index';
^^^^^^
SyntaxError: Cannot use import statement outside a module
I have (aws-amplify/amplify-js#11411) to workaround it by vendoring a bundle that transpiles this package to CommonJS module.
As part of updating my Expo app to SDK 49 I also updated this package to version 2.0.0. After doing this I started running into this issue as well. If I only downgrade this package back to 1.3.0, my tests pass.
Although ES6 imports work with React Native bundlers, Jest does not support it natively.
Recently I introduced this package to our library. It works perfectly in RN integration test but
I have (aws-amplify/amplify-js#11411) to workaround it by vendoring a bundle that transpiles this package to CommonJS module.
According to the Node.js doc on the dual module packages, historically the
main
is entry point for the CommonJS module andmodule
is the entrypoint for the ES6 modules.I think this repo should use the CommonJS require, or at least change the
main
to point to a CommonJS module version of it.I can contribute a PR if we agree this is the right direction.
The text was updated successfully, but these errors were encountered: