Skip to content
\n

Error Output:

\n
[vite] Internal server error: Failed to resolve import \"@/components/GameBoard.vue\"\nError: Cannot find module '/src/components/GameBoard.vue'\n    at resolve (node:internal/modules/esm/resolve:1233)\n
\n

And during build:

\n
Error: Cannot read properties of undefined (reading 'hooks')\n    at createPluginContainer (vite/dist/node/chunks/dep-56f75469.js:5321)\n
\n

Does anyone know how to fix these module resolution issues?

\n

Thanks!

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

The error indicates that Vite can't resolve the file at @/components/GameBoard.vue.
\nPlease verify that:
\nThe file actually exists in src/components/.
\nThe filename matches exactly, including capitalization.
\nYour vite.config.js includes the correct alias:
\nresolve: { alias: { '@': '/src' } }
\nFixing the path or alias should resolve both errors.

","upvoteCount":2,"url":"https://github.com/orgs/vuejs/discussions/14189#discussioncomment-15220913"}}}
Discussion options

You must be logged in to vote

The error indicates that Vite can't resolve the file at @/components/GameBoard.vue.
Please verify that:
The file actually exists in src/components/.
The filename matches exactly, including capitalization.
Your vite.config.js includes the correct alias:
resolve: { alias: { '@': '/src' } }
Fixing the path or alias should resolve both errors.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fatcat006-rgb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants