-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
error when starting dev server on v2.7.11 #6491
Comments
Hello @konstantin24121. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Same here, i've started an open source project here, simply run System: Also tried v2.7.10 of vite, same issue. |
@giorginogreg please create a new issue with your reproduction. The original said that it worked in 2.7.10 so it seems you are hitting a different regression. Thanks! |
Yup. Just bumped into this issue now, was trying out vite for first time. Needed to install commonjs plugin. And by that example, i needed to add plugin in optimizeDeps.esbuildOptions.plugins. But was getting the error. error when starting dev server:
TypeError: Cannot read property 'replace' of undefined
at normalizeId$1 (/Users/akhilmhdh/Akhi/one-platform/packages/feedback-spa/node_modules/vite/dist/node/chunks/dep-48c3e8a4.js:3879:34)
at optimizeDeps (/Users/akhilmhdh/Akhi/one-platform/packages/feedback-spa/node_modules/vite/dist/node/chunks/dep-48c3e8a4.js:56534:34)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async runOptimize (/Users/akhilmhdh/Akhi/one-platform/packages/feedback-spa/node_modules/vite/dist/node/chunks/dep-48c3e8a4.js:60540:48)
at async Server.httpServer.listen (/Users/akhilmhdh/Akhi/one-platform/packages/feedback-spa/node_modules/vite/dist/node/chunks/dep-48c3e8a4.js:60556:21) Then i just applied without any plugin and noticed that, its firing only when plugins is used inside esbuildOptions even as empty array. Here is my config file import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import legacy from '@vitejs/plugin-legacy';
import { viteCommonjs, esbuildCommonjs } from '@originjs/vite-plugin-commonjs';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
viteCommonjs(),
legacy({
targets: ['defaults', 'not IE 11'],
}),
react(),
],
optimizeDeps: {
esbuildOptions: {
plugins: [esbuildCommonjs(['@patternfly/react-styles'])],
},
},
}); Downgraded to v2.7.0, and walla works perfectly. So some issue with v2.7.2 i think so. To reproduce
This one created frustration hell in me 😅 |
Has same issue here. Workaround can be used before new version released:
|
@recih change is in 2.7.12 |
Describe the bug
Just upgraded to v2.7.11, on previous 2.7.10 all starts fine
Reproduction
need reproduction
System Info
Used Package Manager
yarn
Logs
Validations
The text was updated successfully, but these errors were encountered: