Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

NextJS build fails due to import error related to react-merge-refs upgrade #43

Closed
pfarnach opened this issue Aug 9, 2022 · 0 comments · Fixed by #44
Closed

NextJS build fails due to import error related to react-merge-refs upgrade #43

pfarnach opened this issue Aug 9, 2022 · 0 comments · Fixed by #44

Comments

@pfarnach
Copy link

pfarnach commented Aug 9, 2022

Hi there, when importing lamina into my project, I'm getting the following build error in NextJS (12.2.4):

Uncaught Error: require() of ES Module /[My_Project]/node_modules/lamina/node_modules/react-merge-refs/dist/index.mjs not supported.
Instead change the require of /[My_Project]/node_modules/lamina/node_modules/react-merge-refs/dist/index.mjs to a dynamic import() which is available in all CommonJS modules.

This may be a downstream issue but when I reverted lamina to 1.1.20 (changes here where there was a major version bump to react-merge-refs), the build error goes away (and a shader compilation error appears). Apparently NextJS has enabled ES Modules by default since v12. Any thoughts on how to proceed? Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant