remix icon indicating copy to clipboard operation
remix copied to clipboard

NPM Workspaces

Open jaidetree opened this issue 3 years ago • 2 comments

What version of Remix are you using?

1.3.3

Steps to Reproduce

  1. Init a npm monorepo setup
  2. Create a remix app directory called packages/remix and generate a remix app in there (we went with the basic setup vs stack)
  3. Make sure the package.json name is something more unique like @some-org/remix so as not to create any obvious conflicts.
  4. In the root dir run npm install
  5. Run npm run dev -w @some-org/remix

Expected Behavior

Would expect given the above setup that remix runs normally and a remix dev server is started

Actual Behavior

Remix does not like that at all. It will generate a index.d.ts and a index.js file in the packages/remix dir that I think are intended for node_modules/remix.

Running the dev server or building the prod build will produce errors like in #154 about various remix deps missing definitions like MetaFunction or Link, or various generated exports.

Temporary Solution

The good news is I was able to get myself unstuck.

  1. Rename packages/remix to nearly anything else like packages/my-app
  2. After npm install, be sure to run npm run postinstall -w @some-org/my-app. For convenience, create a postinstall script in the root package.json that calls the remix my-app one.

That seems to be working correctly thankfully, but I suspect when it generates index.d.ts and index.js in the packages/remix dir, that is an unintended behavior caused by the remix setup naively mistaking that folder for the node_modules remix dir.

jaidetree avatar Mar 24 '22 04:03 jaidetree

@eccentric-j It have been a long time and a lot have changed. Is this still an issue for you?

machour avatar Jan 24 '23 10:01 machour

Will try creating a mini repro repo and see if edge case still exists

jaidetree avatar Jan 24 '23 11:01 jaidetree

Closing this out, but please re-open if you can provide a reproduction!

brophdawg11 avatar Aug 03 '23 19:08 brophdawg11