-
Notifications
You must be signed in to change notification settings - Fork 133
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
(Workaround) Next.js without SWC plugin #252
Comments
nandorojo
changed the title
Next.js 13 + SWC Compatibility (Solved)
(Solved) Next.js Jan 19, 2023
ReferenceError: i is not defined
ReferenceError: i is not defined
nandorojo
changed the title
(Solved) Next.js
(Workaround) Next.js Jan 19, 2023
ReferenceError: i is not defined
ReferenceError: i is not defined
Another update is live at |
nandorojo
changed the title
(Workaround) Next.js
(Workaround) Next.js without SWC plugin
Jan 21, 2023
ReferenceError: i is not defined
Hermes support was pulled in as well. |
will this bring back the bundle size problem ? |
It shouldn’t affect that. That all lies in how they tree shake Reanimated |
I opened a PR to fix this at reanimated once and for all: software-mansion/react-native-reanimated#3997 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Making an issue here for visibility.
Workaround
yarn add moti@swc
(This installs0.21.1-alpha.6
at the time of writing)Add this at the top of
pages/_app.tsx
:next.config.js
(until it's fixed).Overview
I created a reproduction here of Reanimated not working with SWC: https://github.com/nandorojo/reanimated-next13-issue
Here's the Next.js issue: vercel/next.js#43886
And the Reanimated issue: software-mansion/react-native-reanimated#3971
Expected Behavior
Reanimated should work on Next.js. Due to its architecture, this requires an SWC plugin. However, the plugin is not working.
If you use Reanimated without a plugin, it doesn't break anything, but animations don't usually run. However, On the
swc-hack
branch, I figured out a way to get Reanimated working on Web without a plugin.The result will not affect native, only Web (when enabled). The solution adds re-renders to power animations. It shouldn't be noticeable.
Steps To Reproduce
No response
Versions
Screenshots
Reproduction
https://github.com/nandorojo/reanimated-next13-issue
The text was updated successfully, but these errors were encountered: