Closed leoj3n closed 5 years ago
I'm going to move this to done-serve as the problem is likely there. I can't imagine why this would be different based on the strategy though.
Hm, looks like I can't move the issue to another org. Would you might reposting this in done-serve?
Maybe don't move it though because I don't use done-serve
. I use done-ssr-middleware
with feathers@3 express if that makes sense. I can share that code if necessary. Does done-serve
wire something up special to make incremental work? Maybe I need to emulate that or use done-serve
?
EDIT:
I can confirm the site that worked after being pushed to production is falling back to http/1.1
I'm new to h2 and haven't done anything with keys or certs so I assume I need to change something about how the server part of my app works.
I'll try and replicate the relevant parts of done-serve
and open an issue there if I can't work it out.
So you should be configuring your express server not to let node_modules/
requests hit the SSR middleware. I'm not an express expert but I believe you can do app.use('/node_modules', static('path/to/node_modules'))
and it shouldn't hit the other middleware. done-serve should be doing something similar (but likely isn't).
I was able to correct the /node_modules
404 status with res.sendStatus(404)
after express.static
:
.use(express.static(app.get('client')))
.use('/node_modules', (req, res) => {
res.sendStatus(404);
})
.configure(middleware);
Although, it's not entirely clear to me why that is needed when using incremental
but not for seo
.
strategy: 'seo'
The "don't panic" message (expected):
strategy: 'incremental'
The "failed promise" error (unexpected):
How can we stop it trying to parse the 404 HTML as JavaScript?
My app is very similar to bitballs that uses incremental without such errors:
EDIT:
I figured what the heck and tried deploying this same code to Heroku and magically it works in production without this 404 business. Any idea why that is? Development still 404ing on HTML.