Coder Social home page Coder Social logo

Comments (6)

richardscarrott avatar richardscarrott commented on June 22, 2024

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.

from webpack-hot-server-middleware.

Aetherall avatar Aetherall commented on June 22, 2024

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

from webpack-hot-server-middleware.

Aetherall avatar Aetherall commented on June 22, 2024

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 ...

from webpack-hot-server-middleware.

Aetherall avatar Aetherall commented on June 22, 2024

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

from webpack-hot-server-middleware.

richardscarrott avatar richardscarrott commented on June 22, 2024

@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?

from webpack-hot-server-middleware.

Aetherall avatar Aetherall commented on June 22, 2024

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

from webpack-hot-server-middleware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.