jsr icon indicating copy to clipboard operation
jsr copied to clipboard

Resolving node_modules on publish in a monorepo

Open roginfarrer opened this issue 1 year ago • 1 comments

This is my first time using JSR, so hopefully this isn't a silly question!

I have a monorepo (managed with bun) with two workspaces (the library and an app). Most of my node_modules are living in the root workspace directory. In my library directory, I tried running

bunx jsr publish --dry-run

and get an error like this:

error: Cannot find "@react-types/shared"
    at file:///Users/rfarrer/projects/carousel/aria-carousel/src/useCarouselState.ts:4:55
Child process exited with: 1

I'm assuming that JSR cannot resolve it because that module lives in one directory up, and not in the immediate library directory? Is there a solution to this or a current limitation of JSR?

I did find this discussion that suggests using Deno. I'm not using Deno for this project.

roginfarrer avatar May 16 '24 20:05 roginfarrer

Hey, is the repo public? It'd be easier for to figure out the cause if we have a reproduction. This does look like a bug at first glance, but I can only confirm with a reproduction.

lucacasonato avatar May 17 '24 17:05 lucacasonato

@lucacasonato I've a nearly same issue: https://github.com/jsr-io/jsr/issues/543 My repo is public.

jogibear9988 avatar May 22 '24 05:05 jogibear9988

Sorry for the delay, I was waiting until my repo was public.

I actually tried again today, and I cannot recreate the error. I'm now getting an error for #24 about JSX, so I can't publish anyway. It's a bummer, but hopefully I can revisit sometime in the future!

roginfarrer avatar May 23 '24 18:05 roginfarrer