You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vite dev server does not work correctly if the root folder is in a path containing node_modules. the main problem comes when using <script type="module"> in html.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.
It's becasue your html rootFile is in node_modules which computing entry will ignore there.
Then, when open browser, you will get one error ->
[plugin:vite:import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax. You may need to install appropriate plugins to handle the .js file format, or if it's an asset, add "**/*.js" to assetsInclude in your configuration.
It's because the module script node in html is transformed to <script type="module" src="/index.html?html-proxy&index=0.js"></script>.
Then trigger request, but loadResult is still /index.html file content which leads to parse error byes-module-lexer.
Similar #5042 and #13782. Vite does not work correctly if your project is inside node_modules. We're doing checks for node_modules to know if a path is a dependency. Your setup would signal to Vite that every file is part of some dependency.
Describe the bug
vite dev server does not work correctly if the root folder is in a path containing
node_modules
. the main problem comes when using <script type="module"> in html.Reproduction
https://github.com/cany748/vite-server-error
Steps to reproduce
pnpm install
pnpm vite
System Info
Used Package Manager
pnpm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: