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.

bundling is broken

See original GitHub issue

purs-loader starts bundling right after the compilation, but it does not guarantee that all the references to the PureScript modules are already collected. As a result, if compilation ends faster than modules processing, this code continues to add bundle modules that will never be bundled (because bundling is already started at this time).

I’ve got this problem compiling a large JS project with some of PureScript included, while compiling for the server side. For some reason bundling for client side either worked well or problems weren’t obvious.

At least, I’d recommend to throw an error if more bundle modules are tried to be pushed when bundling is already started because else bundle is invalid anyway.

I don’t see any easy way to fix the problem. It’s needed to somehow wait for all the modules except PureScript ones to be processed before starting bundling. It can be done with checking _compilation.modules and not starting bundling unless all non-.purs of them have module.building equals to undefined (see this code). I couldn’t find any better way to determine webpack have finished with the module. Anyway, it looks hacky.

Also, because all the modules must be ready before bundling, PureScript files cannot be used in loaders or as loaders with bundle: true mode. This looks pretty obvious, but probably should be documented. A workaround here can be to use special non-bundling settings for loaders, but haven’t tried it myself yet.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ethulcommented, Oct 12, 2016

Gotcha. I will look into a possible solution to this.

1reaction
dimsmolcommented, Oct 12, 2016

Yes, it’s significant. Especially if you are careful and do not reference JS modules from PureScript code. It reduces code size a lot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - MVC Bundling Not Working
The bundling is not working because of this line <compilation debug="true" targetFramework="4.0">. When in debug, the bundles do not ...
Read more >
Broken when bundled with webpack · Issue #979
I want to bundle my electron app with webpack to reduce the package size and to improve performance. However, got appears to not...
Read more >
Bundling not working in Sitecore MVC
I just had this happen, the issue is that Sitecore is picking on the bundling URL. Need to add your /bundles/css to the...
Read more >
NEW* Broken Resolutions Bundle | Vanguard - YouTube
NEW* Broken Resolutions Bundle | Vanguard. The NEW Broken Resolutions Bundle is now available in the Call of Duty Vanguard and Warzone ...
Read more >
the NEW BROKEN RESOLUTIONS BUNDLE in VANGUARD ...
Soo yeah today I take a look at the new Broken Resolutions Bundle in Warzone and Vanguard! This pack includes the new "Midnighter"...
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