Comments (11)
Switched to ts-node and now it works great :)
from blues-stack.
Odd! Does this reproduce successfully every time you start? I'm kinda thinking this was a fluke that's probably not easy/worth investigating 😬
from blues-stack.
It happens every time I run it! I've tried about 30 times and haven't had a single run where it didn't have the same behavior.
❯ node -v
v16.14.0
❯ npm -v
8.3.1
from blues-stack.
Dang! It looks like the error is coming from esbuild
. Maybe related to our use of esbuild-register
in the mocks. If you comment out this line
blues-stack/other/pm2.config.js
Line 13 in c2e893c
from blues-stack.
With that line commented the large error message is gone.
We've got one rebuild triggering a restart of the server during boot-up, not sure if that might be part of the cause of the error message with mocks enabled.
❯ npm run dev
> dev
> pm2-dev ./other/pm2.config.js
===============================================================================
--- PM2 development mode ------------------------------------------------------
Apps started : Server,Server Build,Remix,Tailwind
Processes started : 4
Watch and Restart : Enabled
Ignored folder : node_modules
===============================================================================
Server-0 | Debugger listening on ws://127.0.0.1:9229/0981dbea-080a-43a7-834a-ac031b79332a
Server-0 | For help, see: https://nodejs.org/en/docs/inspector
Server Build-1 | > build:server
Server Build-1 | > esbuild --platform=node --format=cjs ./server.ts --outdir=build "--watch"
Server Build-1 | [watch] build finished, watching for changes...
Tailwind-3 | > generate:css
Tailwind-3 | > tailwindcss -o ./app/styles/tailwind.css "--watch"
Server-0 | 🔌 setting up prisma client to localhost:5432
Server-0 | ✅ app ready: http://localhost:3000
Remix-2 | Watching Remix app in development mode...
Server-0 | Debugger listening on ws://127.0.0.1:9229/640f9795-0f0a-46ea-8c75-967e558b05d7
Server-0 | For help, see: https://nodejs.org/en/docs/inspector
Tailwind-3 | Rebuilding...
Remix-2 | 💿 Built in 337ms
Server-0 | 🔌 setting up prisma client to localhost:5432
Server-0 | ✅ app ready: http://localhost:3000
Tailwind-3 | Done in 237ms.
from blues-stack.
I've seen someone else report this same issue. I'm still unable to reproduce this personally. Maybe we should come up with a different approach for what we're doing. I like using esbuild-register, but we could use ts-node instead...
from blues-stack.
I can confirm the existence of the bug, I have it with the original blues stack without any modification on Windows 11 WSL 2 (Ubuntu) with the following versions:
- Node: v16.14.1
- NPM: 8.5.0
For me, this error does not occur at the first launch after booting the PC.
from blues-stack.
If I comment out the "Server Build" aspect of pm2 we don't cause "Server" to be restarted halfway through boot-up, removing the error.
❯ npm run dev
> dev
> pm2-dev ./other/pm2.config.js
===============================================================================
--- PM2 development mode ------------------------------------------------------
Apps started : Server,Remix,Tailwind
Processes started : 3
Watch and Restart : Enabled
Ignored folder : node_modules
===============================================================================
Server-0 | Debugger listening on ws://127.0.0.1:9229/e862d854-3acb-4940-9022-9bc16b48eb45
Server-0 | For help, see: https://nodejs.org/en/docs/inspector
Server-0 | 🔶 Mock server running
Tailwind-2 | > generate:css
Tailwind-2 | > tailwindcss -o ./app/styles/tailwind.css "--watch"
Remix-1 | Watching Remix app in development mode...
Server-0 | 🔌 setting up prisma client to localhost:5432
Server-0 | ✅ app ready: http://localhost:3000
Tailwind-2 | Rebuilding...
Remix-1 | 💿 Built in 364ms
Tailwind-2 | Done in 227ms.
I don't see any way in pm2 for an app to be dependent on another app, would be great to have "Server" wait for "Server Build" to be complete before starting.
from blues-stack.
Dang! It looks like the error is coming from
esbuild
. Maybe related to our use ofesbuild-register
in the mocks. If you comment out this lineblues-stack/other/pm2.config.js
Line 13 in c2e893c
does it have the same problem still?
I noticed the same issue in a fresh project. Commenting out this line seems to remove the problem. Is there some other information I could provide to help with debugging? 🙂
from blues-stack.
Same here, happy to help just unsure how 😄
from blues-stack.
Same issue here. I have a pipeline setup in ArgoCD to build my Remix app. Argo says everything was successful, then after about 30 seconds of watching the log I get:
Done in 86302ms.
[Feb 16 2023 18:08:27 GMT-0500] remix-saas-kit-devtron-demo-6f85648fb9-kbt8n: [1] The service was stopped
[Feb 16 2023 18:08:27 GMT-0500] remix-saas-kit-devtron-demo-6f85648fb9-kbt8n: [1] 💿 Built in 5m 28.5s
[Feb 16 2023 18:08:27 GMT-0500] remix-saas-kit-devtron-demo-6f85648fb9-kbt8n: [1] Error: The service is no longer running
[Feb 16 2023 18:08:27 GMT-0500] remix-saas-kit-devtron-demo-6f85648fb9-kbt8n: [1] at sendResponse (/app/node_modules/@remix-run/dev/node_modules/esbuild/lib/main.js:677:13)
[Feb 16 2023 18:08:27 GMT-0500] remix-saas-kit-devtron-demo-6f85648fb9-kbt8n: [1] at handleRequest (/app/node_modules/@remix-run/dev/node_modules/esbuild/lib/main.js:740:7)
[Feb 16 2023 18:08:27 GMT-0500] remix-saas-kit-devtron-demo-6f85648fb9-kbt8n: [1] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[Feb 16 2023 18:08:28 GMT-0500] remix-saas-kit-devtron-demo-6f85648fb9-kbt8n: [1] cross-env NODE_ENV=development remix dev exited with code 1
I run node 16.x. I also load pm2 in my Github Action but nothing fancy. You mention ts-node - where do I use that? btw: This happens in dev and prod mode.
Cheers, Dave
from blues-stack.
Related Issues (20)
- New Defer API does not work with blues-stack HOT 11
- When Using Express Adapter Throwing Responses will break the app HOT 1
- great repro
- Race condition in npm run dev HOT 5
- Base Repo OOMs on Fly.io HOT 7
- Fly.io -> Error: Can't reach database server HOT 7
- `npm run typecheck` fails on fresh project HOT 7
- blues-stack 2.0.0-pre.5 - LiveReload is not working HOT 2
- v2_dev leaves one node process behind after shutdown HOT 1
- Scripts variant in README to support the Yarn inclined HOT 1
- Deployment issue. Node version >18 needed
- Update server.ts to watch version.txt
- Error when trying to run the docker image HOT 3
- Latest server.js code breaks HDR HOT 1
- Some URLs in the `/build` path were 404 not found after making changes in development mode HOT 1
- Vite support
- Build failed while running npm run build on blues stack HOT 2
- Install an esm package dependency
- Error Code 134 on Deploy of Base Repo HOT 5
- OOM error in deploy requires NODE_OPTIONS space size to be increased/defined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blues-stack.