GithubHelp home page GithubHelp logo

Comments (11)

kentcdodds avatar kentcdodds commented on April 25, 2024 1

Switched to ts-node and now it works great :)

from blues-stack.

kentcdodds avatar kentcdodds commented on April 25, 2024

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.

zolrath avatar zolrath commented on April 25, 2024

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.

kentcdodds avatar kentcdodds commented on April 25, 2024

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

"--require ./mocks",
does it have the same problem still?

from blues-stack.

zolrath avatar zolrath commented on April 25, 2024

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.

kentcdodds avatar kentcdodds commented on April 25, 2024

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.

antoninbeaufort avatar antoninbeaufort commented on April 25, 2024

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.

zolrath avatar zolrath commented on April 25, 2024

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.

Zloka avatar Zloka commented on April 25, 2024

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

"--require ./mocks",

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.

RealMattOwen avatar RealMattOwen commented on April 25, 2024

Same here, happy to help just unsure how 😄

from blues-stack.

kubeworkz avatar kubeworkz commented on April 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.