Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'href' of undefined #4731

Closed
chilijung opened this issue Jul 5, 2018 · 1 comment
Closed

Cannot read property 'href' of undefined #4731

chilijung opened this issue Jul 5, 2018 · 1 comment

Comments

@chilijung
Copy link

chilijung commented Jul 5, 2018

Bug report

Describe the bug

Don't know what happened inside next.js, prompting error I don't understand. Hope someone could point me a direction that I might know where to find the problem. Thanks

I'm getting this:

TypeError: Cannot read property 'href' of undefined
    at getURL (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/next/dist/lib/utils.js:155:30)
    at new Router (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/next/dist/lib/router/router.js:101:29)
    at _callee3$ (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/next/dist/server/render.js:235:22)
    at tryCatch (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/@babel/runtime/helpers/asyncToGenerator.js:12:30)
    at _next (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:9)
    at <anonymous>
TypeError: Cannot read property 'href' of undefined
    at getURL (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/next/dist/lib/utils.js:155:30)
    at new Router (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/next/dist/lib/router/router.js:101:29)
    at _callee3$ (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/next/dist/server/render.js:235:22)
    at tryCatch (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/@babel/runtime/helpers/asyncToGenerator.js:12:30)
    at _next (/Users/lijung/Documents/canner/canner-firebase-cms/node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:9)
    at <anonymous>

To Reproduce

You can try by clone this branch and start, npm run dev
https://github.com/Canner/canner-firebase-cms/tree/nextjs

go to path /dashboard

System information

  • OS: macOS
  • Browser (if applies) : chrome
  • Version of Next.js: 6.1.1
@chilijung
Copy link
Author

I resolve this issue myself, I accidentally assign window variable to a blank {}, which will make things break when server-side rendering.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant