Skip to content
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

Obscure Webpack Import Error #206

Open
MentalGear opened this issue Jun 12, 2021 · 0 comments
Open

Obscure Webpack Import Error #206

MentalGear opened this issue Jun 12, 2021 · 0 comments

Comments

@MentalGear
Copy link

Just wanted to share this somewhat obscure error message and how I solved it, in case others come across it.

ERROR Failed to compile with 1 errors
ERROR in ./.nuxt/components/plugin.js
Syntax Error: Unexpected token (10:2)

10 | : () => import('../../components/index.vue' /* webpackChunkName: "components/" */).then(c => wrapFunctional(c.default || c))
| ^
11 | }
12 |
13 | for (const name in components) {

After a few hours, I realized that I renamed a file to index.vue in the /components folder without noticing it, which apparently crashes nuxt with this error. (Maybe something could also be done to make that error clearer.)

Takeaway:

Don't put a index.vue file into components (or probably any other place but /pages folder).

@danielroe danielroe reopened this Jun 12, 2021
@pi0 pi0 transferred this issue from nuxt/nuxt Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants