nrwl / nx-labs

A collection of Nx plugins
MIT License
138 stars 49 forks source link

@nx/remix | serve executor | command option not working properly #334

Open Mat-moran opened 1 year ago

Mat-moran commented 1 year ago

Hi, I am trying to configure MSW in a Remix app and I am stuck with the serve executor command.

This is how they launch MSW in the Indie Stack Remix template.

"dev": "remix dev -c \"npm run dev:serve\"",
"dev:serve": "binode --require ./mocks -- @remix-run/serve:remix-serve ./build",

In order to do that with the @nx/remix serve executor is necessary to pass the -command flag wich I am doing in this way.

"serve": {
      "executor": "@nx/remix:serve",
      "options": {
        "port": 4200,
        "command": "pnpm run \"binode --require ./app/tests/mocks -- @remix-run/serve:remix-serve ./build\""
      }
    },

but it is giving me the next error

 ERR_PNPM_NO_SCRIPT  Missing script: "binode
Command ""binode" not found.
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^
Error: connect ECONNREFUSED 127.0.0.1:4200
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16) {
  errno: -61,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 4200
}
Node.js v18.12.1

Also this is maybe related with #331 because in order to use -c flag in the remix cli, the v2_dev flag in remix.config should be true.

Any one can help on this? :pray: Thanks

kosiakMD commented 5 months ago

@Mat-moran does it fail at the run? I have the same error after some time after a successful run https://github.com/nrwl/nx/issues/22547