Next.js: Unhandled Rejection (TypeError): Cannot read property 'call' of undefined when clicking Link

Created on 8 Nov 2018  路  7Comments  路  Source: vercel/next.js

Bug report

Describe the bug

When running next.js in dev mode and clicking on a link, the error Unhandled Rejection (TypeError): Cannot read property 'call' of undefined until the linked page has been refreshed at least once. It seems to be related to using sass, css and typescript exports.

To Reproduce

Follow the readme in this repository: https://github.com/leanovate/nextjs-hmr-bug

Expected behavior

When clicking the link, the linked page appears and no error is thrown.

Screenshots

hmr-bug

hmr-bug

System information

  • OS: macOs
  • Browser: Chrome version 70.0.3538.77
  • Version of Next.js: 7.0.2

Most helpful comment

@MoritzR Solve the ESLint warning and the problem is solved.

E.g: Modify .eslintrc file

{
  ....
  "rules": {
    ...
    "no-console": 1
  }
}

All 7 comments

@timneutkens I am not sure that zeit/next-plugins#282 is related to the same problem.
I tried the suggested solution but it didn't have an effect: https://github.com/leanovate/nextjs-hmr-bug/tree/no-fix-update-to-canary-plugins-plus-app-fix

It seems to be related to sass/css though. Should I re-create this ticket in zeit/next-plugins?

@MoritzR How are you?? could you find some workaround to fix that? Seems like in FF works, but in no in Chrome, do you see it?

could you find some workaround to fix that? Seems like in FF works, but in no in Chrome, do you see it?

@Jero786 You can have a look at a workaround here: https://github.com/leanovate/nextjs-hmr-bug/pull/3
I need some more time to understand everything related to the problem but maybe you can get some more insights from the workaround.

@MoritzR Solve the ESLint warning and the problem is solved.

E.g: Modify .eslintrc file

{
  ....
  "rules": {
    ...
    "no-console": 1
  }
}

@MoritzR Solve the ESLint warning and the problem is solved.

E.g: Modify .eslintrc file

{
  ....
  "rules": {
    ...
    "no-console": 1
  }
}

@MoritzR Seems like it's working after I put that rule!!! thanks a lot! after almost a month I could work again with Chrome!! thank you very very much!!!!

None of the fixes I've tried so far worked for me, so I've come up with this one: https://github.com/zeit/next-plugins/issues/282#issuecomment-450578740

Was this page helpful?
0 / 5 - 0 ratings