debugging/inspecting in SSR server_dev.js
See original GitHub issueHey Lee,
I’m looking to debug the server_dev.js
process in the node-inspector. In server_dev.js
, the childProcess.fork seems the place to put a debug signal. but it doesn’t work. Have you managed to debug a node process that webpack keeps killing and re-spawning?
class ServerDevPlugin {
apply(compiler) {
compiler.plugin('done', () => {
if (this.server) this.server.kill();
this.server = childProcess.fork(path.resolve(PATHS.dist, 'server_dev.js'), {
cwd: PATHS.dist,
});
this.server.send('SIGUSR1')
});
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to Debug Server Side Rendering - Bitovi
With SSR, the server renders the entire page and sends it to the browser. ... But this will require a Node.js debugger.
Read more >Server-Side Rendering Performance: Testing and Debugging ...
Using ssr:inspect to debug with breakpoints. With a simple command, you can use Chrome DevTools to debug the local backend of your server-side...
Read more >Debug SSR node.js server side VSCode - Stack Overflow
I've lost too many hours trying to debug an SSR react application (the server side). We're building an app from scratch, and it's...
Read more >Learn How to Debug the Cause of Memory Leak in SSR
Debugging the cause of SSR memory leak in Next.js ... When started with the --inspect switch, you are able to start inspecting client...
Read more >Advanced Features: Debugging - Next.js
Debug your Next.js app. ... Streaming SSR · React Server ... Launching the Next.js dev server with the --inspect flag will look something...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
--inspect
switch released in https://github.com/reactql/kit/releases/tag/1.17.0Added to CLI https://github.com/reactql/cli/releases/tag/3.9.0
Upgrade with
npm i -g reactql
@lawwantsin - the point of Webpack on the server is not having to make special provisions for your code; it’s implicitly isomorphic.
You can write
import someImage from 'src/image.png'
orimport css from './someSassFile.scss'
and know that it’ll work perfectly everywhere – without worrying about server-side file hashing, Zopfli/Brotli compression, considering how CSS classes might match up, etc.In fact, it’s the reason you can
import
anything at all.Taking Webpack out of the equation on the server pushes those considerations into userland - and they’re generally not easy problems to solve.
Of course, you don’t need to use Webpack. You could write your code using
require()
, avoid importing files relative to the project root, avoid treating images or CSS like local JS code, and handle your own build process via gulpfiles or similar.But the aim of ReactQL is to avoid complexity, and keep the browser and server (for the most part!) singing from the same sheet without worrying about that stuff.