-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Module parse failed: Unexpected token (2:4) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders #9209
Comments
Please follow the issue template, and if possible provide a repo that reproduces the problem. This speeds up things a lot 🙏 |
I guess one of the things I forgot to mention in the "issue template" was that you should follow the same exact instructions I followed on the Next.js steps for getting started. I will attach a link to a repo. |
The above repo is the exact code that is resulting in the mentioned error. I do not have any problem running any other (non-nextjs) node apps locally. |
I'm assuming you have a |
I just looked at the documentation and the typical Next.js project will not have a Something to note is I even tried the create-next-app method as well as the manual method and I am still getting the same error when navigating to my local server. I should mention that before I go to
But as soon as I navigate to the server url in the browser I am met with the same error on each attempt:
|
@kylerRenneker you don't need a |
@kylerRenneker can you provide the full output from booting up Next.js to the error? I'm quite certain you have a .babelrc up the directory tree this means it's not in the directory that you're booting up Next.js in but actually in one of the directories above that. The cli output will show you something along the lines of |
@rafaelalmeidatk @timneutkens I guess Ill will have to dig around for that .bablrc file unless yall know of another solution?? Is there a way to prevent next.js app from looking for that file? |
Well, I wish I had more to add than this...but it spontaneously started working. I deleted the old project folder and started from scratch following the same steps as before and now the project is running. |
This happened to me because I was importing shared JSX code from outside of my nextjs app's directory from elsewhere in my mono repo. This was my solution: #706 (comment) |
Excuse me. |
I'm getting this error, too. I'm trying to set up npx create-next-app but i always see this error. How can i fix this? |
@timneutkens I came across the same error just recently. I am in the process of migrating the creat-react-app part of my current cra/express.js setup. How do I solve this?
Doesn't say anything about a babel.rc file though. Just for completeness sake, I actually do have a |
Also seeing this issue on my windows computer, but not on any of my Mac's 🤔 |
Am able to get around this by creating the next app directly on my desktop. But no idea why it doesn't work in the standard |
In my case it is failing with the same error because I run the project from This is rather a pain, but at least it works. |
Related to the above comment. To get around this error, I needed to instead navigate to |
Oh my god 🤦♂️ Thanks past myself. You helped me again! |
This solves the problem for me. Thanks @ackvf. |
NextJS introduced an experimental option to allow imports from outside the project directory. I tried it out in our mono repo and was able to get it to work |
Yeah, it works for me, thank you so much |
I had a similar situation. The folder where the nextjs project was installed is a symlink for another drive. It wont work, but if I run npm run dev on the original folder(and drive), it works perfectly. What ackvf told worked. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
I have been following the exact steps for starting a Next.js app here: https://nextjs.org/learn/basics/getting-started/setup
I also followed the steps for starting a next.js app on Shopify (I want to develop an app there).
I have worked heavily with react but never with next. When I go running the
npm run dev
command I keep getting the following error:The text was updated successfully, but these errors were encountered: