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

Upgrade to 9.96.4 possibly breaks next.js builds #1797

Closed
szpasztor opened this issue Jan 25, 2024 · 7 comments
Closed

Upgrade to 9.96.4 possibly breaks next.js builds #1797

szpasztor opened this issue Jan 25, 2024 · 7 comments
Labels
bug Something isn't working Stale Inactive issue

Comments

@szpasztor
Copy link

szpasztor commented Jan 25, 2024

A recent upgrade of this library seems to break builds in repos that have it as a dependency, possibly ones that also have sharp as dependency. Please see details of partial reproducibility signs below.

Package versions:

├─┬ @react-three/drei@9.82.0
│ ├─┬ @react-spring/three@9.6.1
│ │ └── three@0.156.1 deduped
│ ├─┬ camera-controls@2.7.3
│ │ └── three@0.156.1 deduped
│ ├─┬ maath@0.6.0
│ │ └── three@0.156.1 deduped
│ ├─┬ meshline@3.1.7
│ │ └── three@0.156.1 deduped
│ ├─┬ three-mesh-bvh@0.6.8
│ │ └── three@0.156.1 deduped
│ ├─┬ three-stdlib@2.29.4
│ │ └── three@0.156.1 deduped
│ ├── three@0.156.1 deduped
│ └─┬ troika-three-text@0.47.2
│   ├── three@0.156.1 deduped
│   └─┬ troika-three-utils@0.47.2
│     └── three@0.156.1 deduped
├─┬ @react-three/fiber@8.15.15
│ └── three@0.156.1 deduped
└── three@0.156.1
  • node version: v18.17.0

  • npm (or yarn) version: 1.22.19

Problem description:

Build with no package.json, or code edits of any kind breaks both locally (next.js production build) and on vercel with:

...
 ✓ Compiled successfully
   Collecting page data  ...TypeError: a is not a function
    at Object.<anonymous> (.../node_modules/@react-three/drei/index.cjs.js:1:8601)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at mod.require (.../node_modules/next/dist/server/require-hook.js:64:28)
    at require (node:internal/modules/cjs/helpers:110:18)
    at 14165 (.../.next/server/pages/landing.js:1:55084)
    at __webpack_require__ (.../.next/server/webpack-runtime.js:1:145)

> Build error occurred
Error: Failed to collect page data for /landing
    at /.../node_modules/next/dist/build/utils.js:1171:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'Error'
}
error Command failed with exit code 1.

The stacktrace resolves to an obfuscated file from the package. I have narrowed down the issue based on the following:

  • our team has built/deployed the project yesterday and even earlier today successfully
  • in the last few hours, builds fail, even when attempting to build the identical codebase with identical package versinos to what was successfully deployed earlier
  • our reference to react-three/drei was made using "@react-three/drei": "^9.82.0", – based on this, and given that a new version (9.96.4) was released two hours ago, the above package.json reference automatically evaluated to 9.96.4 via ^ (the latest non-major update)
  • builds have started failing within this 2 hour window
  • I have confirmed that manually pointing the package version to 9.82.0 results in a successful build (next.js production build).

We have not investigated further, and don't known the exact cause, but based on the above data points, there's likely an issue related / introduced by the new version.

Relevant code:

"dependencies": {
    "@react-three/drei": "^9.82.0", // auto-resolved to 9.96.4 today
    "@react-three/fiber": "^8.14.1",
    ...
@szpasztor szpasztor added the bug Something isn't working label Jan 25, 2024
@alessiocancian
Copy link

I'm having the same problem but I don't have sharp installed, maybe it's the right time to switch to npm ci...

@CodyJasonBennett
Copy link
Member

Try disabling SWC minification and/or pinning to an earlier version like 14.0.1 if using newer features.

This has been a repeat issue with Next.js (e.g. most recently vercel/next.js#58557)

@avarayr
Copy link

avarayr commented Jan 26, 2024

Quick fix

npm i --save-exact @react-three/drei@9.96.1

@CodyJasonBennett
Copy link
Member

v9.96.4 had ce3eb7e. cc @drcmda

@CodyJasonBennett
Copy link
Member

I put out v9.96.5 which reverts that change.

Copy link

Thank you for contributing! We’re marking this issue as stale as a gentle reminder to revisit it and give it the attention it needs to move forward.

Any activity, like adding an update or comment, will automatically remove the stale label so it stays on our radar.

Feel free to reach out on Discord if you need support or feedback from the community. This issue will close automatically soon if there’s no further activity. Thank you for understanding and for being part of the project!

@github-actions github-actions bot added the Stale Inactive issue label Oct 30, 2024
Copy link

github-actions bot commented Nov 7, 2024

We’re closing this issue to keep our project manageable and make room for other active work, but we truly appreciate your effort and contribution.

If you’d like to continue working on this, please feel free to re-open it or reach out on Discord — our community is always ready to support you. Thanks again for helping us stay organized and for understanding our approach!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale Inactive issue
Projects
None yet
Development

No branches or pull requests

4 participants