Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve race condition in npm run dev #422

Merged
merged 1 commit into from
Mar 23, 2023
Merged

Conversation

humphd
Copy link
Contributor

@humphd humphd commented Mar 23, 2023

This adds a 3s delay to help fix the race condition that happens when starting dev where the server isn't ready when Remix wants to start.

There is probably a better way to accomplish it, but I'm sick of having it not do the right thing every other run.

To test: npm run dev and you should have:

 npm run dev

> @senecacdot/[email protected] predev
> npm run build:server


> @senecacdot/[email protected] build:server
> esbuild --platform=node --format=cjs ./server.ts --outdir=build --bundle


  build/server.js  2.2mb ⚠️

⚡ Done in 45ms

> @senecacdot/[email protected] dev
> cross-env NODE_ENV=development SECRETS_OVERRIDE=1 run-p dev:remix dev:server:delay


> @senecacdot/[email protected] dev:remix
> remix watch


> @senecacdot/[email protected] dev:server:delay
> run-s delay dev:server


> @senecacdot/[email protected] delay
> node -e "setTimeout(() => process.exit(0), 3000)"

Watching Remix app in development mode...
💿 Built in 299ms

> @senecacdot/[email protected] dev:server
> node --inspect --require ./node_modules/dotenv/config ./build/server.js

Debugger listening on ws://127.0.0.1:9229/04316e34-6cd4-4702-a967-5420c18857d7
For help, see: https://nodejs.org/en/docs/inspector
info: 🔌 setting up prisma client to 127.0.0.1:3306
debug: Expiration Requests init: adding jobs for certificate/record expiration
info: ✅ app ready: http://localhost:8080
info: process DNS record expiration
info: TODO: process certificate expiration

@humphd humphd requested a review from a user March 23, 2023 00:50
@humphd humphd self-assigned this Mar 23, 2023
@humphd humphd requested a review from Eakam1007 March 23, 2023 01:39
@Eakam1007 Eakam1007 added the area: devOps Services/tools that are not our main functionality, but help the project label Mar 23, 2023
@humphd humphd merged commit 4896d02 into DevelopingSpace:main Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: devOps Services/tools that are not our main functionality, but help the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants