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.

Nextjs13 - TypeError: Cannot read properties of undefined (reading 'call')

See original GitHub issue

Verify canary release

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

Which example does this report relate to?

none

What browser are you using? (if relevant)

Version 1.46.144 Chromium: 108.0.5359.128 (Official Build) (64-bit)

How are you deploying your application? (if relevant)

No response

Describe the Bug

I am trying out the new nextJS 13 app directory but i keep getting TypeError: Cannot read properties of undefined (reading 'call') on the client side when i use a component with 'use client'

i use "next": "13.0.7" AppInfo.tsx

'use client'

export default function AppInfo() {
   return (
      <>
         <h1>client</h1>
      </>
   )
} 

page.tsx

import AppInfo from './appinfo';

export default async function Dashboard() {

  return (
    <>
      <div className="flex flex-col gap-5 max-w-[1028px] mx-auto px-4">
        <h1 className="mt-5 text-3xl font-light">
          👋 Hi, <span className="font-bold text-gray-400 ">Admin</span>
        </h1>
        <AppInfo/>
      </div>
    </>
  )
}

Expected Behavior

no error

To Reproduce

AppInfo.tsx

'use client'

export default function AppInfo() {
   return (
      <>
         <h1>client</h1>
      </>
   )
} 

page.tsx

import AppInfo from './appinfo';

export default async function Dashboard() {

  return (
    <>
      <div className="flex flex-col gap-5 max-w-[1028px] mx-auto px-4">
        <h1 className="mt-5 text-3xl font-light">
          👋 Hi, <span className="font-bold text-gray-400 ">Admin</span>
        </h1>
        <AppInfo/>
      </div>
    </>
  )
}

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Reactions:5
  • Comments:13

github_iconTop GitHub Comments

3reactions
mehmetkursataydincommented, Dec 19, 2022

Seems to be OK in MacOS environment but got the same error on Windows.

2reactions
Emyboycommented, Dec 19, 2022

I’m having the same issue just by creating a new project with npx create-next-app@latest --experimental-app and typescript

This issue only occurs when I use the experimental app directory

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read properties of undefined (reading 'call') on Next.js ...
Unhandled Runtime Error TypeError: Cannot read properties of undefined (reading 'call') Call Stack options.factory ...
Read more >
Cannot read property 'call' of undefined - random error after ...
After running npm run build && NODE_ENV=production node server.js when opening the application I am getting this error TypeError: Cannot read ...
Read more >
nextjs typeerror: cannot read properties of undefined (reading ...
I have error: 'TypeError: Cannot read properties of undefined (reading 'map')'. I understand what this error means. But I still understand, why ingredients....
Read more >
Cannot Read Property Length of Undefined in JavaScript
The JavaScript TypeError: Cannot read property 'length' of undefined occurs when the length property is read on an undefined variable.
Read more >
getInitialProps - Data Fetching - Next.js
getInitialProps receives a single argument called context , it's an object with the following properties: pathname - Current route.
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