Giter VIP home page Giter VIP logo

Comments (5)

humphd avatar humphd commented on April 27, 2024 1

@kwabe007 this is better for sure, thanks for sharing.

from blues-stack.

humphd avatar humphd commented on April 27, 2024

I found that even changing https://github.com/remix-run/blues-stack/blob/main/package.json#L10 to this helps a bunch:

"dev": "run-p dev:build dev:remix dev:server",

from blues-stack.

kwabe007 avatar kwabe007 commented on April 27, 2024

Just ran into this issue today as well when trying to follow this stack's dev/build scripts. Explicitly expanding the script names didn't work for me but as a workaround I've set a three second delay for the dev:server script:

"delay": "node -e \"setTimeout(() => process.exit(0), 3000)\"",
"dev:server": "npm run delay && cross-env NODE_ENV=development node --inspect --require ./node_modules/dotenv/config --require ./mocks ./build/server.js"

And now it works without having to run npm run build first.

But it's still a potential race condition though, although the longer the delay the less likely it is.

UPDATE
For anyone reading this in the future: if you don't mind installing an npm package, you can use wait-on to wait for the build files to exist before trying to run node. This way, you don't have to wait longer than needed (or risk not waiting long enough); you'll wait just until the files are built. In my case I installed the package and updated the scripts in package.json:

"scripts": {
  ...
  "dev:server": "cross-env NODE_ENV=development npm run wait-build && node --inspect --require ./node_modules/dotenv/config --require ./mocks ./build/server.js",
  "wait-build": "wait-on -t 20000 ./build/server.js ./build/index.js"
},

The -t 20000 option makes wait-on wait a maximum of 20,000 ms (20 seconds) for the files before failing.

Another alternative if you don't want to add another npm dependency is to write a custom node script which polls for the files existence and use that instead.

from blues-stack.

jsrhodes15 avatar jsrhodes15 commented on April 27, 2024

I'm wondering if this issue should be resolved with the latest release of remix?

https://github.com/remix-run/remix/releases/tag/remix%401.16.0

I have used the Blue Stack pretty much as-is, so I'm not 100% sure on the internals. But if I understand correctly, couldn't the scripts be changed such that dev is just a single command?

from blues-stack.

Jesus-fhz avatar Jesus-fhz commented on April 27, 2024

Hi there,

Updating to node 20 fixed this issue for me.

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.