Description
Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes
npm: 6.4.1
node: v9.10.1
Which terms did you search for in User Guide?
package.json, Unexpected token...
Environment
System:
OS: macOS 10.14.1
CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Binaries:
Node: 9.10.1 - ~/.nvm/versions/node/v9.10.1/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v9.10.1/bin/npm
Browsers:
Chrome: 70.0.3538.102
Firefox: 61.0.2
Safari: 12.0.1
npmPackages:
react: ^16.6.3 => 16.6.3
react-dom: ^16.6.3 => 16.6.3
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found
Steps to Reproduce
(Write your steps here:)
- install cra
- create a component in a folder with an package.json in it which is referring the main component file
- import it in App.js
- keep building successfully
- eject cra
- build fails with unexpected token in the imported component
Expected Behavior
I expect it to build successfully
Actual Behavior
Build fails on first JSX from the imported component with an unexpected token error.
Reproducible Demo
Did a very basic demo of the bug.
App before ejecting is here: https://github.com/derpoho/cra-packaged-components-error/tree/master => builds
App after eject is here: https://github.com/derpoho/cra-packaged-components-error/tree/ejected => fails
Thanks guys, keep up the good work!