admin管理员组文章数量:1405393
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 es 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?
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 es 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?
Share Improve this question edited Jan 23, 2023 at 4:57 GLHF asked Jan 14, 2023 at 8:13 GLHFGLHF 4,05710 gold badges46 silver badges94 bronze badges 3- Can you tell your node version? – Youssouf Oumar Commented Jan 14, 2023 at 9:35
- @yousoumar it's v14.17.4 – GLHF Commented Jan 14, 2023 at 9:38
- can you share the repo? – Yilmaz Commented Jan 22, 2023 at 1:45
5 Answers
Reset to default 2This 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 patible with the version of Next.js you're using.
Next.js docs: https://beta.nextjs/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 mand npx create-next-app -g
this mand 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./package/next
If the explanation is not enough please let me know I will update the answer.
If the error only throws on Chrome, here's a similar case discussed.
Check out if you have VPN or Ad-Blocker enabled. I also had unknown connection errors with it, so I disabled those while on localhost URLs.
If it still doesn't work, then try setting reactStrictMode
to false
on next.config.js
Here's the link you may find helpful.
However, it's not a good solution long-term-wise to turn off strictMode
as @joaogarin mentioned on the link page.
- Please update your node.js to latest LTS.
- If you are using experimental app directory, be informed that it is still in Beta and you may see some bugs there.
If the problem is not resolved, I strongly suggest you to share your code and the tutorial you followed so that others can help.
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 es from an extension or whatsoever) and solve the problem via this way.
The culprit, in my case, was Reactime. This drove me nuts!
本文标签:
版权声明:本文标题:javascript - NextJS console logs TypeError on console everytime I make a request on localhost: Cannot read properties of undefin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744301854a2599620.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论