Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 317
GLHF Avatar asked Oct 12 '25 00:10

GLHF


1 Answers

This is not caused because of code bug.

You can try to disable the development mode on next.js by setting the dev property to false in the next.config.js file.

module.exports = {
  dev: false,
  // ...other config
}

This might help to see if the error is caused by the development environment or not.

Update Node.js

Make sure that you're using a version of Node.js that is compatible with the version of Next.js you're using.

Next.js docs: https://beta.nextjs.org/docs/installation

The easiest way to do that would be to go the Node.js site and download the proper v16.9 executable.

Please update to Node.js 16.8 or later.

Update Next.js

Run the command npx create-next-app -g this command will create a new Next.js app and also update the global installation of Next.js to the latest version.

In package.json check Next.js version.

Check if the version is latest. Docs: https://www.npmjs.com/package/next

If the explanation is not enough please let me know I will update the answer.

like image 145
Smit Gabani Avatar answered Oct 14 '25 16:10

Smit Gabani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!