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.06k stars 674 forks source link

Chapter 3 End - Next/Express server not starting #195

Closed sivaram-psg closed 1 year ago

sivaram-psg commented 1 year ago

When I run 'yarn dev' in chapter3-end/app folder, express/nextjs server not starting. The below are console logs

_(base) sree@sree-HP-Laptop-15-da0xxx:~/code/bank_login_book/saas/book/3-end/app$ yarn dev yarn run v1.22.19 $ nodemon server/server.ts [nodemon] 2.0.7 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): server/*/ [nodemon] watching extensions: ts [nodemon] starting ts-node --project tsconfig.server.json server/server.ts Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db event - compiled successfully

Ready on undefined_

sivaram-psg commented 1 year ago

I observe NEXT_PUBLIC_PORT_APP and NEXT_PUBLIC_URLAPP have the value of 'undefined' . After setting this values while starting the server, there are no issues 'NEXT_PUBLIC_PORT_APP=3000 NEXT_PUBLIC_URLAPP=http://localhost nodemon server/server.ts'

klyburke commented 1 year ago

@sivaram-psg Thanks for reporting. Did you solve the problem by adding values to your environmental variables, NEXT_PUBLIC_PORT_APP and NEXT_PUBLIC_PORT_API?

I just tested the 3-end code and was able to successfully run the app and api projects. For the above environmental variables, I am using:

NEXT_PUBLIC_PORT_APP=3000
NEXT_PUBLIC_PORT_API=8000