How to fix [vite-node] Failed to load module? #1385
-
Hi, upon testing react components i get this error message: Error: [vite-node] Failed to load 'module name'. What is the issue here and how to fix it? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Can be anything. You might misspelled it. You might not have it installed. The path might be wrong. |
Beta Was this translation helpful? Give feedback.
-
the issue is that i used absolute path for module importa from root dir, and vitest didn't understand this. i had to rename to relative paths in app. |
Beta Was this translation helpful? Give feedback.
-
in my case i had a path like
to our vitest.config.js |
Beta Was this translation helpful? Give feedback.
the issue is that i used absolute path for module importa from root dir, and vitest didn't understand this. i had to rename to relative paths in app.