Search code examples
javascriptreactjstypescriptnext.jstypeerror

NextJS console logs TypeError on console everytime I make a request on localhost: Cannot read properties of undefined (reading '_owner')


Edit:I also realized that this only occurs on Chrome, in other browsers I'm not seeing these errors.

I just have created a simple NextJS project following couple of tutorials, it's TypeScript included, but after I npm run dev I see below log on console

TypeError: Cannot read properties of undefined (reading '_owner')
    at t (backend.bundle.js:1:119865)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122106)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122106)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at E (backend.bundle.js:1:122126)
    at n (backend.bundle.js:1:123584)
    at c (backend.bundle.js:1:123643)
    at backend.bundle.js:1:124007
    at 496 (backend.bundle.js:1:125067)
    at i (backend.bundle.js:1:110)
    at backend.bundle.js:1:902
    at backend.bundle.js:1:913

The project works properly, it doesn't block anything, but why am I seeing this log everytime?

I also tried to start new projects using create-next-app and just ran the project, but still even everything is created by default (I didn't even touch any file) I still got the above error message.

Everytime I make request to a URL on localhost, it logs the above error message. I have no idea what's this, I think it comes from NextJS inside, it's not even relevant to my codes (I don't even have a variable or something called "owner" or even "own")

Why I see this error message on the console? How can I get rid off it?,

Edit: After I've added couple of elements, It has started to throw this too

TypeError: Cannot read properties of undefined (reading '0')
    at t (backend.bundle.js:1:119861)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122106)
    at t (backend.bundle.js:1:122074)
    at t (backend.bundle.js:1:122074)
    at E (backend.bundle.js:1:122126)
    at n (backend.bundle.js:1:123584)
    at c (backend.bundle.js:1:123643)
    at backend.bundle.js:1:124007
    at 496 (backend.bundle.js:1:125067)
    at i (backend.bundle.js:1:110)
    at backend.bundle.js:1:902
    at backend.bundle.js:1:913

Because of this console messages, after 5-10 renders, on console I see 500+ messages and this is frustrating. How can I get rid of this issue?


Solution

  • Turns out, the problem occurs only on Chrome. So after some digging, I've figured out that a Chrome extension causes this problem. It's neither about Node.js version or being in development mode.

    But right now, the problem is, the console.log()s are too much and they take lots of space in console (after I use the project for like 3-4 minutes, then when I go to console, it takes 3-4 seconds to be interactive because of the thousands console.logs() waiting for finish).

    I'll try to block any console.log() message (even if it comes from an extension or whatsoever) and solve the problem via this way.