question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Call of undefined while first time load after next build

See original GitHub issue

I am still getting call of undefined error. I think its because i require npm package in componentWillMount. I also tried in componentDidMount. I got the error for the first time i load the after build. How to solve this.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
malikimprowisedcommented, Jul 19, 2017

For example if i add package like this way only for client side

 componentDidMount() {
    d3 = require("d3");
  }

Now if i do client side navigation to the component that acquire this code. At that time during first navigation i get the error.

0reactions
malikimprowisedcommented, Aug 21, 2017

It works for me. I use npm and my script in package.json is

"scripts": {
    "dev": "node server.js",
    "build": "next build",
    "start": "NODE_ENV=production node server.js"
  },

and when i do npm run build it gets build.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'call' of undefined - random error after ...
After running npm run build && NODE_ENV=production node server.js when opening the application I am getting this error TypeError: Cannot ...
Read more >
react ajax call is undefined at first - Stack Overflow
The problem is that your app exists and is showing before you have all the data ready. The axios call takes a very...
Read more >
Modules, introduction - The Modern JavaScript Tutorial
Modules can load each other and use special directives export and import to ... A module code is evaluated only the first time...
Read more >
How to solve Next.js window is not defined
An easy solution to resolve this issue is to rely on the useEffect , conveniently hooks aren't run when doing server-side rendering. Wrapping ......
Read more >
react-hydration-error - Next.js
The first render is called Hydration which is a feature of React. This can cause the React tree to be out of sync...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found