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.

chunk not available for synchronous require yet

See original GitHub issue

When I try to set webpackChunkName in import(), I get this in linux console:

trace (Click to show)


chunk not available for synchronous require yet: /components/Home: Cannot find module '/components/Home' Error: Cannot find module '/components/Home'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at requireById (/home/anton/Documents/workspace-sts/nodejs-spring-cloud-app-boilerplate/node_modules/react-universal-component/dist/utils.js:59:19)
    at tryRequire (/home/anton/Documents/workspace-sts/nodejs-spring-cloud-app-boilerplate/node_modules/react-universal-component/dist/utils.js:45:12)
    at requireSync (/home/anton/Documents/workspace-sts/nodejs-spring-cloud-app-boilerplate/node_modules/react-universal-component/dist/requireUniversalModule.js:42:37)
    at UniversalComponent.componentWillMount (/home/anton/Documents/workspace-sts/nodejs-spring-cloud-app-boilerplate/node_modules/react-universal-component/dist/index.js:193:23)
    at processChild (/home/anton/Documents/workspace-sts/nodejs-spring-cloud-app-boilerplate/node_modules/react-dom/cjs/react-dom-server.node.development.js:2167:16)
    at resolve (/home/anton/Documents/workspace-sts/nodejs-spring-cloud-app-boilerplate/node_modules/react-dom/cjs/react-dom-server.node.development.js:2061:5)
    at ReactDOMServerRenderer.render (/home/anton/Documents/workspace-sts/nodejs-spring-cloud-app-boilerplate/node_modules/react-dom/cjs/react-dom-server.node.development.js:2380:22)


and shows an error `error: serverRenderer is not a function`.

If I do not try to change chunk name, it works, but the error is showed in console anyway.

specs:

  • “webpack”: “^4.12.0”,
  • “webpack-hot-server-middleware”: “^0.5.0”,
  • “babel-plugin-universal-import”: “faceyspacey/babel-plugin-universal-import#webpack-4”,
  • “webpack-flush-chunks”: “^2.0.1-beta.1”

And most interesting is: when I start dev server whithout commented webpackChunkName instruction, but change them on the fly, without restart server (HMR works), no errors shows in browser, only console always contains that error. In any case.

May be, my server setup has smth wrong…

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:32 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ScriptedAlchemycommented, Jul 31, 2018

Hmmm @rherwig If you are not able to then I’m inclined to dedicate my efforts into other areas of this project in desperate need of upgrades. One being a been call to developers who want to help us out with getting an alpha release of Rudy #justSaying

1reaction
ScriptedAlchemycommented, Jul 31, 2018

@rherwig ahh thank you, its could likely by a yarn.lock or package-lock.json file messing with him?

I discovered a few React-Static issues related to that

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Use Synchronous Chunk Writes' Not Working In Minecraft ...
In Minecraft 'Server Settings', “Use Synchronous Chunk Writes” does not properly modify the server.properties and is always overriden with ...
Read more >
How to use Webpack's new “magic comment” feature with ...
It gives your Webpack server a synchronous way to require your component, without the client including it in the parent chunk's dependencies. ...
Read more >
Webpack - mimics synchronous lazy import - Stack Overflow
The solution in your question is the only way I'm aware of currently. However, the require variable in your code is not present...
Read more >
WHY do triggers execute in chunks of 200 records, if still ...
So, Apex batches records into groups of 200 because the Salesforce runtime has to call database methods ("Stored Procedures") that are limited ...
Read more >
Online Synchronous Strategies
Engaging students during synchronous sessions · Invite students to think about the topics related to your subject matter but not extensively covered in...
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