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
With latest version of create-react-app that is using @babel/core@7.17.0 (launched 2/2/22 at 15:00PST) the same App that was use to build correctly now is throwing build errors.
Did you try recovering your dependencies?
yes
Which terms did you search for in User Guide?
babel
react-scripts
Environment
(paste the output of the command here.)
Steps to reproduce
Init my app
npx create-react-app test-app
cd test-app
npm i aws-amplify
Add AWS Amplify to my App
importlogofrom'./logo.svg';import'./App.css';importAmplifyfrom'aws-amplify';functionApp(){return(<divclassName="App"><headerclassName="App-header"><imgsrc={logo}className="App-logo"alt="logo"/><p>
Edit <code>src/App.js</code> and save to reload.
</p><aclassName="App-link"href="https://reactjs.org"target="_blank"rel="noopener noreferrer">
Learn React
</a></header></div>);}exportdefaultApp;
Start my app npm start
Expected behavior
Build and run the app with no errors (as it used to happen previously)
(Write what you thought would happen.)
Actual behavior
When building the App I have this errors
Compiled with problems:X
ERROR in ./node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: /private/var/folders/mk/36m2f9gx7h5bblhkkx68fv1ck8cth9/T/tmp.PwdKmnIU/test/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.js: Cannot read properties of undefined (reading 'originalPositionFor')
at SourceMapTree.originalPositionFor (/private/var/folders/mk/36m2f9gx7h5bblhkkx68fv1ck8cth9/T/tmp.PwdKmnIU/test/node_modules/@ampproject/remapping/dist/remapping.umd.js:159:27)
at trace (/private/var/folders/mk/36m2f9gx7h5bblhkkx68fv1ck8cth9/T/tmp.PwdKmnIU/test/node_modules/@ampproject/remapping/dist/remapping.umd.js:102:37)
at EncodedSourceMapImpl.map (/private/var/folders/mk/36m2f9gx7h5bblhkkx68fv1ck8cth9/T/tmp.PwdKmnIU/test/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js:347:36)
at TraceMap.map (/private/var/folders/mk/36m2f9gx7h5bblhkkx68fv1ck8cth9/T/tmp.PwdKmnIU/test/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js:430:31)
at SourceMapTree.traceMappings (/private/var/folders/mk/36m2f9gx7h5bblhkkx68fv1ck8cth9/T/tmp.PwdKmnIU/test/node_modules/@ampproject/remapping/dist/remapping.umd.js:85:34)
at remapping (/private/var/folders/mk/36m2f9gx7h5bblhkkx68fv1ck8cth9/T/tmp.PwdKmnIU/test/node_modules/@ampproject/remapping/dist/remapping.umd.js:258:36)
at mergeSourceMap (/private/var/folders/mk/36m2f9gx7h5bblhkkx68fv1ck8cth9/T/tmp.PwdKmnIU/test/node_modules/@babel/core/lib/transformation/file/merge-map.js:19:30)
at generateCode (/private/var/folders/mk/36m2f9gx7h5bblhkkx68fv1ck8cth9/T/tmp.PwdKmnIU/test/node_modules/@babel/core/lib/transformation/file/generate.js:72:39)
at run (/private/var/folders/mk/36m2f9gx7h5bblhkkx68fv1ck8cth9/T/tmp.PwdKmnIU/test/node_modules/@babel/core/lib/transformation/index.js:55:33)
at run.next (<anonymous>)
and similar error on other packages
Reproducible demo
git clone https://github.com/elorzafe/cra-issue-babel.git
cd cra-issue-babel
npm i
npm start
The text was updated successfully, but these errors were encountered:
Seems related to babel/babel#14209 (switching to use@ampproject/remapping for source map merging), which was released with 7.17.0. Not sure if the root cause is in @babel/core or @ampproject/remapping.
Describe the bug
With latest version of
create-react-app
that is using@babel/core@7.17.0
(launched 2/2/22 at 15:00PST) the same App that was use to build correctly now is throwing build errors.Did you try recovering your dependencies?
yes
Which terms did you search for in User Guide?
babel
react-scripts
Environment
(paste the output of the command here.)
Steps to reproduce
npx create-react-app test-app cd test-app npm i aws-amplify
npm start
Expected behavior
Build and run the app with no errors (as it used to happen previously)
(Write what you thought would happen.)
Actual behavior
When building the App I have this errors
Reproducible demo
git clone https://github.com/elorzafe/cra-issue-babel.git cd cra-issue-babel npm i npm start
The text was updated successfully, but these errors were encountered: