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 14 pnpm build fail #429

Open
zbw-zbw opened this issue Nov 14, 2023 · 8 comments
Open

next 14 pnpm build fail #429

zbw-zbw opened this issue Nov 14, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@zbw-zbw
Copy link

zbw-zbw commented Nov 14, 2023

image
@zbw-zbw
Copy link
Author

zbw-zbw commented Nov 14, 2023

image

@zbw-zbw zbw-zbw changed the title next 14 pnpm build 打包失败 next 14 pnpm build fail Nov 14, 2023
@pionxzh pionxzh added the bug Something isn't working label Nov 16, 2023
@pionxzh
Copy link
Collaborator

pionxzh commented Nov 17, 2023

Can you share a minimal reproducible repo? I tried creating a clean Next14 project with json-viewer, and it works fine.

The stackbliz example is broken on Next.js 14 because of an issue from stackbliz itself stackblitz/core#1904

@zbw-zbw
Copy link
Author

zbw-zbw commented Nov 17, 2023

Can you share a minimal reproducible repo? I tried creating a clean Next14 project with json-viewer, and it works fine.

The stackbliz example is broken on Next.js 14 because of an issue from stackbliz itself stackblitz/core#1904

try to use App router

@zbw-zbw
Copy link
Author

zbw-zbw commented Nov 17, 2023

it could be resolved with no ssr.

@pionxzh
Copy link
Collaborator

pionxzh commented Nov 17, 2023

I tried with App router, and it works fine. Please provide a minimal reproducible repo so that I can help on this.

@pionxzh
Copy link
Collaborator

pionxzh commented Nov 17, 2023

Oh there is a error from mui. Looks like mui is having some issues with Next 14

Internal error: TypeError: Cannot read properties of undefined (reading '0')
    at Paper (./node_modules/@mui/material/Paper/Paper.js:101:26)
    at renderWithHooks (./node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.development.js:8245:26)
    at renderForwardRef (./node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.development.js:8433:28)
    at renderElement (./node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.development.js:8589:29)
    at renderNodeDestructiveImpl (./node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.development.js:8778:33)
    at renderNodeDestructive (./node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.development.js:8735:28)
    at finishFunctionComponent (./node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.development.js:8383:17)
    at renderIndeterminateComponent (./node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.development.js:8337:17)
    at renderElement (./node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.development.js:8528:21)
    at renderNodeDestructiveImpl (./node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.development.js:8778:33)

@pionxzh
Copy link
Collaborator

pionxzh commented Jan 24, 2024

Most of the errors have gone on Next.js 14.1.0.

For people who are using Next App Directory:

With the new App Directory, React Components are categorized into two: Server Components and Client Components, and by default they are all Server Component as mentioned in: Using Server Components in Next.js.

Components that need hooks (context, use...) need to be classified as Client Components and they need to have the directive "use client" at the top of the source file before any import.

#442 (comment)

@pionxzh
Copy link
Collaborator

pionxzh commented Jan 24, 2024

Found another error related to zustand or react context. Registered built-in is missing on the server side.

 ⨯ node_modules/@textea/json-viewer/dist/index.mjs (1265:14) @ matchTypeComponents
 ⨯ Internal error: Error: No type matched for value: 1
    at matchTypeComponents (./node_modules/@textea/json-viewer/dist/index.mjs:1290:15)
    at eval (./node_modules/@textea/json-viewer/dist/index.mjs:1297:63)
    at Object.oL [as useMemo] (./node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:12:72230)
    at t.useMemo (./node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:163482)

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