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
🐛 Bug Report: TypeError: Cannot read properties of undefined (reading 'createServer') #24678
Comments
Im on the same team as @marcpalm. Just commenting our backstage info here:
|
Reproduction steps on the demo site:
"@vitejs/plugin-react": "^4.0.4",
"vite": "^4.4.9",
"vite-plugin-html": "^3.2.0",
"vite-plugin-node-polyfills": "^0.21.0"
|
Following |
I would also like to note that after a certain version of Vite, you are required to be on node 18+. This should probably also be updated to the latest version in backstage/cli on the vite plugins. it is on like 5.x.x. But this bug is happening for me as well. Same issue. For me I had to actually install the dependencies listed here in my backstage instance. But getting the same error. |
@vinzscam with the addition of the "help wanted" tag, is it safe to assume our proposed change is fine? |
📜 Description
While running the frontend with EXPERIMENTAL_VITE=true, it crashes with
TypeError: Cannot read properties of undefined (reading 'createServer')
👍 Expected behavior
App starts up. This happened on our app while upgrading all modules, but can be reproduced with https://github.com/backstage/demo
👎 Actual Behavior with Screenshots
Return
TypeError: Cannot read properties of undefined (reading 'createServer')
and stops.👟 Reproduction steps
Run https://github.com/backstage/demo with vite enabled.
📃 Provide the context for the Bug.
Problem is here:
backstage/packages/cli/src/lib/bundler/server.ts
Line 174 in 9c45fa1
Dynamic import works when changed to
const vite = import('vite')
, the default seems not properly resolved.🖥️ Your Environment
Node 18 or 20
yarn
MacOS
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Code of Conduct?
Are you willing to submit PR?
No, but I'm happy to collaborate on a PR with someone else
The text was updated successfully, but these errors were encountered: