Skip to content
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

Next.js: 'unstable_act' is not exported from 'react' #83

Open
maximilianberndt opened this issue Jun 6, 2024 · 2 comments
Open

Next.js: 'unstable_act' is not exported from 'react' #83

maximilianberndt opened this issue Jun 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@maximilianberndt
Copy link

When trying to build in next.js I am getting this error:

./node_modules/react-ogl/dist/reconciler.mjs
Attempted import error: 'unstable_act' is not exported from 'react' (imported as 'React').

Seems like the issue is coming from this in reconciler.ts:
export const act: Act = 'unstable_act' in React ? (React as any).unstable_act : (React as any).act

I don't have experience with testing in react, so I would really appreciate your help but let me know if I can help you debug this in any way.

@CodyJasonBennett CodyJasonBennett added the bug Something isn't working label Jun 6, 2024
@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented Jun 6, 2024

Next.js bundles an experimental copy of React which does not reflect your installed copy, so this is particularly troublesome to debug or even support in the ecosystem as it is SemVer breaking. We'll officially support new APIs with #81.

We did try to fix this issue in #80 and #82. I think I need to break both tree-shaking and static analysis of React in order to fix this.

It's possible we have to wait until React 19 and #81 in order for Next to be usable in OSS.

@maximilianberndt
Copy link
Author

@CodyJasonBennett Got it, thanks for the quick reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants