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

Throw an error if no source maps to upload #68

Open
villesau opened this issue Nov 9, 2021 · 2 comments
Open

Throw an error if no source maps to upload #68

villesau opened this issue Nov 9, 2021 · 2 comments
Labels
backlog We hope to fix this feature/bug in the future feature request Request for a new feature

Comments

@villesau
Copy link

villesau commented Nov 9, 2021

Description

if there is no source maps to upload, the plugin just sits there silently without doing anything.

Describe the solution you'd like

Would be beneficial if there was an error that would be thrown when there is nothing to upload. This would help troubleshooting a lot (in our case, no source maps were generated while I thought it was the plugin that fails). After all, the plugin is used to upload source maps so it should also expect to have something to upload.

@mattdyoung
Copy link
Contributor

Hi @villesau

Thanks for the feedback. With the webpack plugin I'm not sure we'd want to fail the build by default as the plugin will be automatically run by webpack as part of the build there may be some legitimate cases where source maps aren't produced.

We'll look into how best to communicate this scenario though, or whether we could have an option to fail the build.

@mattdyoung mattdyoung added backlog We hope to fix this feature/bug in the future feature request Request for a new feature labels Nov 16, 2021
@villesau
Copy link
Author

@mattdyoung I think there should not be a legitimate reason not to produce source maps if the plugin is in use. If you don't produce source maps you should not use the plugin either. So it is a misconfiguration that should fail the build. If there still is a valid use case for not having source maps and having the plugin, an ecape hatch would be having a toggle to suppress the exception. So I would do it other way around: I'd provide way to bypass the exception, but throw it by default. Though, you could then skip adding the plugin in the first place.

For example we use exactly the same setup for staging & prod, but for staging we do not include the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants