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

fix: interop Zustand for CJS #1550

Merged
merged 3 commits into from
Jun 30, 2023

Conversation

CodyJasonBennett
Copy link
Member

Fixes #1544.

@vercel
Copy link

vercel bot commented Jun 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2023 2:03pm

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 30, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e544a8b:

Sandbox Source
immutable-wind-nqvrxc Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration

@CodyJasonBennett CodyJasonBennett changed the title fix: don't Terser mangle CJS fix: interop Zustand for CJS Jun 30, 2023
@CodyJasonBennett CodyJasonBennett merged commit 1dfc307 into pmndrs:master Jun 30, 2023
3 checks passed
@CodyJasonBennett CodyJasonBennett deleted the fix/no-terser-mangle branch June 30, 2023 14:04
@github-actions
Copy link

🎉 This PR is included in version 9.77.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@timoisalive
Copy link

timoisalive commented Jun 30, 2023

Hey, not sure if this is the reason but I just started getting:

Uncaught TypeError: create is not a function
    at ./node_modules/@react-three/drei/core/useProgress.js

in my project which has

    "@react-three/drei": "^9.68.6",
    "zustand": "^4.3.8"

Seems like

    "@react-three/drei": "9.77.7",

works fine.

@CodyJasonBennett
Copy link
Member Author

CodyJasonBennett commented Jun 30, 2023

Can you share that project or try with the following in package.json?

"dependencies": {
    "@react-three/drei": "https://pkg.csb.dev/pmndrs/drei/commit/56656e4d/@react-three/drei"
}

The ^ symbol masks the actual resolved version, so I'm afraid I can't do much on my side to debug.

@caioaamaral
Copy link

@CodyJasonBennett Had the same problem, using "@react-three/drei": "https://pkg.csb.dev/pmndrs/drei/commit/56656e4d/@react-three/drei" fixed for me

for instance, I was at "^9.77.8"

@jglee96
Copy link

jglee96 commented Jun 30, 2023

codesandbox

v9.77.8 has same error.
Using "@react-three/drei": "https://pkg.csb.dev/pmndrs/drei/commit/56656e4d/@react-three/drei" works.
However test fail because of react-merge-refs cjs, esm things.
image

@Hasan-446
Copy link

same error on latest version
image
image
image

@CodyJasonBennett
Copy link
Member Author

Should be fixed (for real) in 9.77.9.

@RhisavRay
Copy link

same error on latest version image image image

I am facing the exact same issue. By when can we expect a fix? Also where do I get this useProgress.js file?

@CodyJasonBennett
Copy link
Member Author

The version after contains a fix. .8 was still a broken build.

@ruslanvasylev
Copy link

ruslanvasylev commented Jul 10, 2023

Hey guys, I'm getting the following when trying to run some tests

Should be fixed (for real) in 9.77.9.

"@react-three/drei": "9.78.1",

TypeError: i is not a function at ../../node_modules/@react-three/drei/index.cjs.js:1:227930

@CodyJasonBennett
Copy link
Member Author

@ruslanvasylev can you share a project and/or try a clean install? I don't see anything wrong since this patch landed.

@jglee96
Copy link

jglee96 commented Jul 11, 2023

@ruslanvasylev can you share a project and/or try a clean install? I don't see anything wrong since this patch landed.

codesandbox
run npm run test then,
image

@CodyJasonBennett
Copy link
Member Author

Releasing 9.78.2 in a moment. This had come from a Rollup upgrade which had been breaking our CJS bundle up to this point. We have e2e tests, I'll try to harden them to test this behavior.

@ruslanvasylev
Copy link

Thank you @CodyJasonBennett; this one seems to pass all tests!

@RhisavRay
Copy link

I am still getting this error. What to do?
image
image

@CodyJasonBennett
Copy link
Member Author

Update to latest Drei with a clean install. If that doesn't work, let me know the version and I can take a look.

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

Successfully merging this pull request may close these issues.

When building a Next.js 13 project using version 9.77.7, an error occurs
7 participants