vite icon indicating copy to clipboard operation
vite copied to clipboard

Uncaught TypeError: t._reverse is not a function

Open pward123 opened this issue 1 month ago • 4 comments

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

pward123 avatar May 16 '24 19:05 pward123