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

Not Compatible with React19/Nextjs15/Vercel #103

Open
afroguy16 opened this issue Nov 22, 2024 · 0 comments
Open

Not Compatible with React19/Nextjs15/Vercel #103

afroguy16 opened this issue Nov 22, 2024 · 0 comments

Comments

@afroguy16
Copy link

afroguy16 commented Nov 22, 2024

Description

Installing nextjs-toploader breaks Vercel deployments with Next.js 15, even when the package is not imported or used in the codebase.

Error Message

TypeError: Cannot read properties of null (reading 'useContext')
    at exports.useContext (/vercel/path0/emu/apps/fsp-chain-demo/node_modules/react/cjs/react.production.js:489:33)
    at h (/vercel/path0/emu/apps/fsp-chain-demo/.next/server/pages/_error.js:1:6051)
    at renderWithHooks (/vercel/path0/emu/node_modules/next/node_modules/react-dom/cjs/react-dom-server.edge.production.js:4184:18)
    at renderElement (/vercel/path0/emu/node_modules/next/node_modules/react-dom/cjs/react-dom-server.edge.production.js:4322:14)
    at retryNode (/vercel/path0/emu/node_modules/next/node_modules/react-dom/cjs/react-dom-server.edge.production.js:4866:16)
    at renderNodeDestructive (/vercel/path0/emu/node_modules/next/node_modules/react-dom/cjs/react-dom-server.edge.production.js:4684:7)
    at renderNode (/vercel/path0/emu/node_modules/next/node_modules/react-dom/cjs/react-dom-server.edge.production.js:5123:14)
    at renderChildrenArray (/vercel/path0/emu/node_modules/next/node_modules/react-dom/cjs/react-dom-server.edge.production.js:5014:7)
    at retryNode (/vercel/path0/emu/node_modules/next/node_modules/react-dom/cjs/react-dom-server.edge.production.js:4880:9)
    at renderNodeDestructive (/vercel/path0/emu/node_modules/next/node_modules/react-dom/cjs/react-dom-server.edge.production.js:4684:7)
Export encountered an error on /_error: /404, exiting the build.
 ⨯ Static worker exited with code: 1 and signal: null
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1

Environment

  • Monorepo: Turborepo
  • Next.js version: 15.0.2
  • React version: 19 (19.0.0-rc-02c0e824-20241028)
  • Deployment platform: Vercel
  • Package manager: Yarn

Steps to Reproduce

  1. Setup a Turborepo monorepo
  2. Create a Next.js 15 app within the monorepo
  3. Add nextjs-toploader to the app's dependencies
  4. Deploy to Vercel
  5. Build fails with useContext error in error pages

Expected Behavior

The package should not break Vercel deployments when installed, regardless of whether it's being used or not.

Actual Behavior

The mere presence of the package in dependencies causes build failures on Vercel during static page generation.

Additional Notes

  • The error occurs even when the package is not imported anywhere in the codebase
  • The error occurs even when the package is used in the codebase
  • Removing the package from dependencies fixes the build

Screenshots

Screenshot 2024-11-22 at 6 35 36 AM Screenshot 2024-11-22 at 6 35 29 AM Screenshot 2024-11-22 at 6 35 20 AM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant