This might be the result of doing stupid things and using react-router in unexpected ways, but I found a mysterious crash that wound up being max callstack exceeded. You can see this if you take the react-router-server-complex-example project and make the following changes:
Remove the <Switch /> element from ./components/App.jsx
Change NoMatch to use async loading like the other routes.
If you visit one route, it works fine... but visit another and hit refresh you'll get a server crash.
On my machine, Windows10 there is no actual error returned from the process.... but you can inspect %ERRORLEVEL% to see what the exit code is... here is the output from the shell,
D:\Code\react-router-server-complex-example>node_modules\.bin\babel-node.cmd --plugins system-import-transformer -- src/server.js
Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
Example site listening on 3000!
^--- server crashes :(
D:\Code\react-router-server-complex-example>echo %ERRORLEVEL%
-1073741571
-1073741571 is a stack overflow exception.
I put a debugger on it in my own project where I found this initially, and I found that context.callback kept getting called, and went into another renderPass which ended up calling context.callback again.
This might be the result of doing stupid things and using
react-router
in unexpected ways, but I found a mysterious crash that wound up being max callstack exceeded. You can see this if you take thereact-router-server-complex-example
project and make the following changes:<Switch />
element from./components/App.jsx
NoMatch
to use async loading like the other routes.If you visit one route, it works fine... but visit another and hit
refresh
you'll get a server crash.On my machine, Windows10 there is no actual error returned from the process.... but you can inspect
%ERRORLEVEL%
to see what the exit code is... here is the output from the shell,-1073741571
is a stack overflow exception.I put a debugger on it in my own project where I found this initially, and I found that
context.callback
kept getting called, and went into anotherrenderPass
which ended up callingcontext.callback
again.I noticed the
then
callback in load was never fired, so add never gets called and the exists check never passes and the modules array kept getting the same module added over & over again.