Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If asset fails to bundle it cause other assets from being bundled #132

Open
bjarnef opened this issue Nov 14, 2021 · 3 comments
Open

If asset fails to bundle it cause other assets from being bundled #132

bjarnef opened this issue Nov 14, 2021 · 3 comments

Comments

@bjarnef
Copy link

bjarnef commented Nov 14, 2021

It seems if bundling of an asset fails it also cause other assets from being bundled.'
In my use-case the updated autocomplete.js asset in v3.3.0 of OpenStreetMap package caused some exceptions thrown by Smidge, which also cause custom block view controllers and Contentment assets not being registered.

I reverted to v3.2.0 of OpenStreetMap package and everything seems to work again.

However should an syntax error or similar in a package JS asset cause other JS assets not being bundled? It should probably still log an error/warning, but maybe it could still process the other JS assets?

See bergmania/Bergmania.OpenStreetMap#14

@Shazwazza
Copy link
Owner

I guess it could try/catch each file and continue to bundle, but if that bundle has JS in a particular order, then the JS loading may fail at runtime

@bjarnef
Copy link
Author

bjarnef commented Nov 19, 2021

But I guess it would only be an issue within a specific part of code, e.g. in a dashboard or a package.
Currently an error (e.g. just a syntax error) in a package may cause everything else to fail: Custom dashboards, block views, property ediors, prevalue editors... if the error happens early in the bundling of the assets.

Not sure if the assets are bundled in a specific order, but it seems to be in alphabetical order, as the error in Bergmania.OpenStreetMap cause missing registered controllers etc, in Contentment and own custom controllers.

@Shazwazza
Copy link
Owner

assets are bundled in the order you add them to a bundle. If you use file globbing patterns, then yes it will be alphabetical. Have marked as help wanted if you want to take a stab at error checking when this occurs. Would be good to have a unit test too. Let me know if you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants