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

Supresses the IO Exception of convert-source-map #6

Merged
merged 1 commit into from
Jul 11, 2020

Conversation

Pouja
Copy link
Contributor

@Pouja Pouja commented Apr 6, 2020

The IO Exception occurs when in the webpack pipeline some files have the .map counterpart but some don't. In our case it happens when some of the files have .js extension where others have .ts

If the user enables the stats of webpack, he/she would still see the warnings.

Closes #5

Copy link
Member

@JamesMessinger JamesMessinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @Pouja! It looks good, but there's one change I'd like you to make to narrow the scope

src/index.ts Outdated
}
} catch (e) {
// Exception is thrown by fromMapFileSource when there is no source map file
if (typeof e === "string" || e instanceof Error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will suppress all errors, not just the ones related to a missing source map. Please check specifically for the missing-sourcemap error, and only suppress that one. Any other error should be re-thrown.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solved it with e.message.includes("An error occurred while trying to read the map file at")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JamesMessinger Can you take a look at this?

The IO Exception occurs when in the webpack pipeline some files have
the .map counterpart but some dont.

If the user enables the stats of webpack, he/she would still see the
warnings.
@Pouja Pouja force-pushed the bugfix/io-exception branch from 75a4f9c to 3ccab96 Compare April 6, 2020 13:53
@JamesMessinger JamesMessinger merged commit 5998eb7 into JS-DevTools:master Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IO exception
3 participants