question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Reactions:7
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
bruceharrison1984commented, 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!

4reactions
e2gooncommented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

An application fails to create a COM+ component
When a client application tries to create a Microsoft COM+ component, the client application may intermittently receive an error message.
Read more >
8.1.1-canary.70 - next - npm
The React Framework. Latest version: 13.1.1, last published: 18 hours ago. Start using next in your project by running `npm i next`.
Read more >
next - NPM Package Versions - Socket.dev
v13.0.8-canary.0. Core Changes. Fix windows slashes for app client entry: #44052; Hash both pitch and main loader for server CSS imports: #44063 ...
Read more >
Rendering: Server and Client Components - Next.js beta docs
Learn how use Server and Client Components in your Next.js application. ... trying to create a context at the root of your application...
Read more >
next 12.2.0 on Node.js NPM - NewReleases.io
latest releases: 13.0.7-canary.4, 13.0.7-canary.3, 13.0.7-canary.1... 5 months ago ... Decouple entries for server components and client components: #36860 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found