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

VSCode Debugger Uncaught Exceptions gets swallowed #66

Open
Aetherall opened this issue Mar 15, 2018 · 6 comments
Open

VSCode Debugger Uncaught Exceptions gets swallowed #66

Aetherall opened this issue Mar 15, 2018 · 6 comments

Comments

@Aetherall
Copy link

By using this package, the errors from the bundles won't trigger the VSCode Debugger, and instead, they will simply get console logged.

To Reproduce : throw an Error

@richardscarrott
Copy link
Member

Sounds like this is the same issue as #62 .

I just use chrome dev tools to debug so haven't run into this problem myself. It looks like vscode needs to know where the transpiled code is output however webpack-dev-middleware (and in turn webpack-hot-server-middleware) uses an in-memory file system.

It might be worth disabling the memory fs (you'd need to comment out this line in webpack-dev-middleware for now https://github.com/webpack/webpack-dev-middleware/blob/878aecd709b161a6cbbbd6e15dd14ba105b1e194/index.js#L62) and then perhaps point the vscode launch.js outFile to the webpack dist dir -- having said that, I'm sure there are other pieces to the puzzle I'm not familiar with though so needs further investigation.

@Aetherall
Copy link
Author

I configure webpack to write file on disk, so this is not the issue
The problem comes from requireFromString(buildedFile) to be call inside a webpack hook
webpack handle the error internally so we don't jump to where it comes from

@Aetherall
Copy link
Author

This is problematic scince react ssr errors gets swallowed too
Is there something to do about that ? This package is great, but makes error hunting so hard ...

@Aetherall
Copy link
Author

a workaround is to add

process.on('unhandledRejection', e => {
	console.log(e)
})

but It will not bring the vscodeDebugger, just print the error in the console

@richardscarrott
Copy link
Member

@Aetherall Are you sure unhandled promise rejections behave differently in webpack-hot-server-middleware vs node require as I can see the warning fine in my tests, perhaps another package in your project is suppressing them by listening to 'unhandledRejection' and forgetting to log them?

@Aetherall
Copy link
Author

Aetherall commented May 4, 2018

I will provide a demo repo soon
I seems like it's the webpack plugin which is swallowing the error
Maybe we can hook the root middleware to a static reference, or maybe the only solution is to update the whole root express app... IDK yet

EDIT: I also want to say that I did my experiment with a clean repo and no other packages than the ones concerned

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