vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.09k stars 27.01k forks source link

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

Closed Alii-isk closed 1 year ago

Alii-isk commented 1 year ago

Verify 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>
    </>
  )
}
ChristopherTrimboli commented 1 year ago

can confirm, I have same issue, happened after upgrade to 13.0.7

kaceycleveland commented 1 year ago

The canary build they have solved it for me. There are some issues I am running into with navigation and the back button though.

Emyboy commented 1 year ago

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

Emyboy commented 1 year ago

The canary build they have solved it for me. There are some issues I am running into with navigation and the back button though.

I've been having the same issue with navigation as well. I even noticed it on the NextJs website 😄

mehmetkursataydin commented 1 year ago

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

bulentala commented 1 year ago

on windows I get the same error in version "next": "13.0.7". "next": "13.0.6", version ok

github-actions[bot] commented 1 year ago

Please verify that your issue can be recreated with next@canary.

Why was this issue marked with the please verify canary label?

We noticed the provided reproduction was using an older version of Next.js, instead of canary.

The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. You can think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running npm install next@canary and test it in your project, using your reproduction steps.

If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.

How can I quickly verify if my issue has been fixed in canary?

The safest way is to install next@canary in your project and test it, but you can also search through closed Next.js issues for duplicates or check the Next.js releases. You can also use the GitHub template (preferred), or the CodeSandbox or StackBlitz templates to create a reproduction with canary from scratch.

My issue has been open for a long time, why do I need to verify canary now?

Next.js does not backport bug fixes to older versions of Next.js. Instead, we are trying to introduce only a minimal amount of breaking changes between major releases.

What happens if I don't verify against the canary version of Next.js?

An issue with the please verify canary that receives no meaningful activity (e.g. new comments that acknowledge verification against canary) will be automatically closed and locked after 30 days.

If your issue has not been resolved in that time and it has been closed/locked, please open a new issue, with the required reproduction, using next@canary.

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the :+1: reaction on the topmost comment (please do not comment "I have the same issue" without repro steps). Then, we can sort issues by votes to prioritize.

I think my reproduction is good enough, why aren't you looking into it quicker?

We look into every Next.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources

drakata commented 1 year ago

on windows I get the same error in version "next": "13.0.7". "next": "13.0.6", version ok

I got the same issue, using windows, next@13.0.6 works for me too.

dafengzhen commented 1 year ago

try using next@canary

roberto-duran commented 1 year ago

I get the same error on version 13.0.7 downgrade to version 13.0.6 and "evrething" work

roberto-duran commented 1 year ago

try using next@canary

in the canray version its fixed. TY

pogran commented 1 year ago

I get the same error on version 13.0.7 downgrade to version 13.0.6 and "evrething" work

need to wait next release after 13.0.7 ? I think use canary on prod its not a good idea

Alii-isk commented 1 year ago

This issue got fixed in next@canary, so you either gonna use next@canary or wait for the upcoming new version

github-actions[bot] commented 1 year ago

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.