-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Closed
Labels
Description
Describe the bug
The code in the reproduction case only breaks when making a build. Local development works fine.
Related issue on the three.js side to keep track of it:
I have tracked down the difference between local run and a build run being that functionNode.call is undefined in builds, but defined and working in local development:
I am not 100% sure if this is a vite bug during bundling but I don't know where the discrepancy comes from.
Reproduction
https://stackblitz.com/edit/vitejs-vite-9b37bu
Steps to reproduce
- Go to https://stackblitz.com/edit/vitejs-vite-9b37bu
- Open the browser console
- Run npm run start
- Note no errors (code runs fine)
- Cancel the run by pressing Ctrl + C in the terminal
- Run npm run preview which builds the code and hosts the resulting bundled code
- In the console, note error:
Uncaught TypeError: functionNode.call is not a function
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.18.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.4.2 - /usr/local/bin/npm
pnpm: 8.10.5 - /usr/local/bin/pnpm
npmPackages:
vite: ^5.0.4 => 5.0.7Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- 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.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.