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

use of client components causes error in 13.0.7-canary.3 #43854

Closed
1 task done
rafma0 opened this issue Dec 8, 2022 · 11 comments · Fixed by #44011 or #44052
Closed
1 task done

use of client components causes error in 13.0.7-canary.3 #43854

rafma0 opened this issue Dec 8, 2022 · 11 comments · Fixed by #44011 or #44052
Assignees
Labels
kind: bug Confirmed bug that is on the backlog

Comments

@rafma0
Copy link

rafma0 commented Dec 8, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
Binaries:
  Node: 18.4.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 13.0.7-canary.3
  eslint-config-next: 13.0.7-canary.3
  react: 18.2.0
  react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue

https://github.com/rafma0/next-brokenuseclient

To Reproduce

Test.tsx

'use client'

export default function Test () {
  return (
    <p>test</p>
  )
}

page.tsx

import Test from './Test'

export default function HomePage () {
  return (
    <Test />
  )
}

Describe the Bug

Trying to use a client component in server page results in

Uncaught TypeError: Cannot read properties of undefined (reading 'call')
The above error occurred in the <NotFoundErrorBoundary> component
Uncaught Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.

Expected Behavior

The same code works fine in 13.0.7-canary.1

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@rafma0 rafma0 added the bug Issue was opened via the bug report template. label Dec 8, 2022
@frankandrobot
Copy link

This doesn't seem right. Otherwise, the basic hello-world example on the playground would fail.
Try repo'ing this on stackblitz or share your code

@rafma0
Copy link
Author

rafma0 commented Dec 8, 2022

@frankandrobot in stackblitz its working fine, so I guess its probably related to Windows paths again? I edited and added a repro.

@trevorpfiz
Copy link

I am running into this error as well. The same code works in 13.0.7-canary.1 and 13.0.6.

Windows 11
Chrome Version 108.0.5359.99

@tszhong0411
Copy link
Contributor

tszhong0411 commented Dec 9, 2022

I also get this error after the update from 13.0.7-canary.1 to 13.0.7-canary.3.

  • Windows 11
  • Chrome Version 108.0.5359.96

@trevorpfiz
Copy link

Error is still happening on 13.0.7-canary.4 😞

@huozhi huozhi added kind: bug Confirmed bug that is on the backlog and removed bug Issue was opened via the bug report template. labels Dec 14, 2022
@huozhi huozhi self-assigned this Dec 14, 2022
@e2goon
Copy link

e2goon commented Dec 14, 2022

I also get this error after the update from 13.0.7 to 13.0.7-canary.6.

Windows 11

// layout.tsx

import Link from "next/link";
import { PropsWithChildren } from "react";

export default function Layout({ params, children }: PropsWithChildren<any>) {
  return (
    <div>
      <div>
        <Link href={`/${params.lang}/`}>Home</Link>
        <Link href={`/${params.lang}/versions`}>Versions</Link>
      </div>
      <div>{children}</div>
    </div>
  );
}

image

huozhi added a commit that referenced this issue Dec 14, 2022
## Bug

The app client entry key was in win32 slashes like `app\blog`, and when
we add the new layer checking logic in #43197, `name.startsWith('app/')`
doesn't work.

Fixes #43854
Fixes #43902

<img width="862" alt="image"
src="https://user-images.githubusercontent.com/4800338/207641886-08ffc159-0516-4609-9a1f-8c8693586122.png">


- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
@huozhi
Copy link
Member

huozhi commented Dec 15, 2022

Could you try to upgrade to 13.0.7? Should be fixed now 🙏

@tszhong0411
Copy link
Contributor

tszhong0411 commented Dec 15, 2022

Chrome and Edge:
image
Firefox:
image

Error is still happening on 13.0.7-canary.7

@andreaskromann
Copy link

andreaskromann commented Dec 15, 2022

I am still getting the same error as @e2goon with 13.0.7. Only in dev builds. Production builds work for me.
Windows 11 and just a clean npx create-next-app@latest --experimental-app.

@huozhi huozhi reopened this Dec 15, 2022
huozhi added a commit that referenced this issue Dec 15, 2022
Fixes #43854 , followup for #44011. Normalize the bundlePath so it works
in all cases

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
@bruceharrison1984
Copy link

bruceharrison1984 commented Dec 15, 2022

I'm getting this same error when running the OOTB project per https://beta.nextjs.org/docs/installation. Production build works fine, dev throws this error.

Windows 10

13.0.8-canary.0 fixed my issue. Nice job!

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: bug Confirmed bug that is on the backlog
Projects
None yet
8 participants