-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected token after eject with Component Folders with package.json (comment on #5865) #6554
Comments
Also I can add that it chokes on the first line that contains a jsx |
Here's the full expanded copy of the error I get in my console
Of course the error from @derpoho's repo will be more illuminating |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
I just met the same issue and found a workaround. Since Babel reports syntax error it usually means it's not configured correctly. So I guess if a folder contains So I created a module.exports = function(api) {
const presets = ["react-app"];
const plugins = [];
if (api.env("development")) {
// plugins.push('react-hot-loader/babel');
}
return { presets, plugins };
}; Note that you must contain However, sub-folders with package.json just worked in my previous project with old cra and babel :-( |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. |
It's quite frustrating that a very well documented issue is just automatically closed after a few months because it's marked stale, but I understand why such a thing would happen. Anyway, you can consider this a comment to this issue opened just a few months ago: #5865
(I'll even move my comment to that thread if it's unlocked and delete this issue once I move it there to keep things cleaner)
I am also having an unexpected token error on the first jsx angle bracket
<
I have components I placed in my package.json, which are pointing to git repo urls. Everything was working, until I need to create some webpack aliases. So I had to eject, and then the first error I got was this unexpected token error.
I saw this related issue: #3491 But I'm quite sure @derpoho has exactly pinned the issue.
I looked through his repo demonstrating the issue, and wanted to note his changes from a fresh create-react-app:
-Added
import Packaged from './components/Packaged'
to App.jsThis folder is very very simple. Just package.json with main entry pointing to pure functional component that returns a div: https://github.com/derpoho/cra-packaged-components-error/tree/master/src/components/Packaged
Then he ejected.
The text was updated successfully, but these errors were encountered: