async-labs / saas

Build your own SaaS business with SaaS boilerplate. Productive stack: React, Material-UI, Next, MobX, WebSockets, Express, Node, Mongoose, MongoDB. Written with TypeScript.
https://saas-app.async-await.com
MIT License
4.11k stars 682 forks source link

Chapter 3 End - Server Error 426 #194

Closed shaunmichaelwalker closed 1 year ago

shaunmichaelwalker commented 1 year ago

Hello - just refactored from 1- to 2-server architecture as described at the end of Ch. 3 and am getting a 426 error in my app project (frontend):

image

The console messages are printing from here, in sendRequestAndGetResponse.ts:

image

Based on some research, I think this is because the api server will not accept HTTP1.*, which is what it looks the app server is using (printed these opts from sendRequestAndGetResponse.ts):

image

I tried upgrading isomorphic-unfetch to 4.0.2 (current version), deleted yarn.lock and node_modules, and ran yarn. That did nothing. I'm also not having any issue when I access the endpoint directly from the browser:

image

Assuming the Upgrade Required status text does in fact mean I need to upgrade to HTTP2, how can I do this?

klyburke commented 1 year ago

@shaunmichaelwalker Thanks for reporting.

Do you see this error when you run our exact 3-end code?

Please feel free to create a public repo with the exact code you are running, and I'll test it.

tima101 commented 1 year ago

@shaunmichaelwalker I haven't reproduced your issue. But try changing port 3000 to some other value? Say, 3030 or any other allowed and available value on your machine.

Please keep module/library versions the same as described in the book. Upgrading packages may add breaking changes.