-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Description
When running in dev with vite everything works fine, when I run the build for production for example with npm run build && npm run preview
in the repro then I get this error
Initially I ran into this error when working on a new vite framework for storybook but I found the same error present in a users example on the discussions here where it works on dev but fails when serving the static files.
index-DvzMhtGV.js:53 Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at dl (index-DvzMhtGV.js:53:6327)
at index-DvzMhtGV.js:53:48672
at Array.forEach (<anonymous>)
at Dc (index-DvzMhtGV.js:53:48646)
at Object.a [as worklet] (index-DvzMhtGV.js:53:50781)
at o (index-DvzMhtGV.js:53:13912)
Steps to reproduce
in the repro:
- click the terminal
- ctrl + c to end the dev server
- use the command
npm run build && npm run preview
to run a preview of the prod build - note the animation fails and open the browser console to see the error
in general:
- setup react native web with vite
- add reanimated and add the babel plugin to the react plugin's babel config
- add an animated component and attempt to animate it
- build for prod
Snack or a link to a repository
https://stackblitz.com/edit/vitejs-vite-wcfpnl?file=package.json
same repo from the stack blitz:
https://github.com/dannyhw/vite-reanimated-web-prod-repro
to run here just do
npm install
npm run build && npm run preview
The example code is actually mostly taken from here: #5814
In which disabling strict mode fixes one problem but then in the build theres this new error
Reanimated version
~3.16.3
React Native version
^0.76.3
Platforms
Web
JavaScript runtime
V8
Workflow
None
Architecture
None
Build type
Release app & production bundle
Device
None
Device model
No response
Acknowledgements
Yes