Venryx/webpack-runtime-require

Error - window.webpackJsonp" must be set for webpack-runtime-require to function.

dharashah410 opened this issue · 4 comments

The repo does not provide clear steps and documentation. I am getting assertion error "window.webpackJsonp" must be set for webpack-runtime-require to function. What am I doing wrong here?

Assuming you did do step 1 of the readme instructions, the problem might be that you don't have a "vendors" chunk set up for project.

I don't know if this is the problem, but that's my best guess at the moment.

If you want to try it, here's a page explaining how to add a vendors chunk to your webpack project: https://webpack.github.io/docs/code-splitting.html#split-app-and-vendor-code

And sorry about the lack of documentation. I haven't had time to clean it up nicely. I currently just work on it on the side, for use in other projects.

The part about having to create a vendor chunk to use this module was definitely not understood, until I found this issue.

I was hoping this module would let me access all modules, without having to manually specify them. It seems like I am again left having to specify what modules I want exported.

It does let you access all modules without specifying any in particular. The vendor chunk is just required for webpack to provide the "webpackJsonp" method.

There's probably a better way of exposing that method, but I just don't know how yet other than by making a vendors chunk. (from what I remember during my development time, it could even be empty and still work -- though someone else seems to have mentioned that that didn't work, so it will need to be investigated what additional prerequisite is needed, if that doesn't work in your case)

I've made some updates to the library, so now it doesn't require the "webpackJsonp" method.

You can use one of the two other ways that are now explained in the readme (options A or B of step 1): https://github.com/Venryx/webpack-runtime-require