vite
vite copied to clipboard
Uncaught TypeError: t._reverse is not a function
Describe the bug
Anytime I attempt to run a vite+react application in production mode with crypto polyfilled, the application fails to render and displays the following error in the browser js console:
Uncaught TypeError: e._reverse is not a function
at index.e4f79b4f.js:57:13218
at index.e4f79b4f.js:57:13616
at index.e4f79b4f.js:1:23
at index.e4f79b4f.js:60:733
Running the application in dev mode works just fine.
This was originally reported in https://github.com/vitejs/vite/issues/16385. However, that issue was closed and locked since it was specific to vite 2.x. This report is for the same issue in [email protected]
I believe the _reverse call in question is located here
Reproduction
https://github.com/pward123/vite-issue-16385
Steps to reproduce
Follow the instructions in the readme for the reproduction repo
System Info
System:
OS: macOS 13.6.6
CPU: (12) x64 Apple M2 Max
Memory: 3.95 GB / 96.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
pnpm: 8.6.1 - /usr/local/bin/pnpm
Browsers:
Brave Browser: 124.1.65.126
Chrome: 124.0.6367.208
Safari: 17.4.1
npmPackages:
@vitejs/plugin-react: ^4.2.1 => 4.2.1
vite: ^5.2.0 => 5.2.11
Used Package Manager
npm
Logs
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] 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.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.