Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: bun workspace dependencies not resolved #448

Open
juliusmarminge opened this issue Apr 26, 2024 · 3 comments
Open

bug: bun workspace dependencies not resolved #448

juliusmarminge opened this issue Apr 26, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@juliusmarminge
Copy link

ref t3-oss/t3-env#227 (comment)

when a package depends on a workspace package, jsr fails to resolve that import (at least when using Bun):

@t3-oss/env-core published successfully, but when going to publish @t3-oss/env-nextjs it fails with the following error:

image

@dsherret
Copy link
Contributor

dsherret commented May 1, 2024

I looked into this and the reason this fails is because when publishing it resolves @t3-oss/env-core to the other workspace package on the registry, but the registry has no knowledge of the workspace once it gets the tarball for the package.

Most likely, npm workspace specifiers should be changed to a JSR specifier on publish. I opened denoland/deno#23638

As a temporary workaround, I believe adding the following would fix it so that it maps the @t3-oss/env specifier to the jsr package:

--- a/packages/nextjs/jsr.json
+++ b/packages/nextjs/jsr.json
@@ -5,6 +5,9 @@
     ".": "./src/index.ts",
     "./presets": "./src/presets.ts"
   },
+  "imports": {
+    "@t3-oss/env": "jsr:@t3-oss/env@^0.10.3"
+  },
   "include": ["src/**/*.ts", "README.md", "LICENSE", "package.json"],
   "exclude": ["node_modules", "dist", "test"]
 }

@dsherret dsherret added the bug Something isn't working label May 1, 2024
@juliusmarminge
Copy link
Author

Just tried this and it doesn't work:

CleanShot 2024-05-17 at 12 01 33

@MeowningMaster
Copy link

I managed to publish my library on JSR from bun monorepo
https://github.com/MeowningMaster/wsx
https://jsr.io/@wsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Needs Triage
Development

No branches or pull requests

3 participants