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] yarn install fails on minimal repo after paraglide init #1992

Closed
jldec opened this issue Jan 9, 2024 · 3 comments
Closed

[bug] yarn install fails on minimal repo after paraglide init #1992

jldec opened this issue Jan 9, 2024 · 3 comments
Labels
scope: inlang/sdk Related to source-code/sdk. type: bug Something isn't working

Comments

@jldec
Copy link
Contributor

jldec commented Jan 9, 2024

Problem

yarn appears to have slightly different peer dependency resolution compared to npm or pnpm.

This results in a failure installing @inlang/paraglide-js in projects or environments (like codesandbox) where yarn is the default.

$ yarn
yarn install v1.22.19
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "@inlang/paraglide-js > @inlang/language-tag@1.3.0" has unmet peer dependency "@sinclair/typebox@^0.31.17".
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
$ paraglide-js compile --project ./project.inlang
[##################################################################################] 82/82node:internal/errors:490
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sinclair/typebox' imported from /Users/jldec/inlang/yarn-paraglide/node_modules/@inlang/language-tag/dist/interface.js
    at new NodeError (node:internal/errors:399:5)
    at packageResolve (node:internal/modules/esm/resolve:889:9)
    at moduleResolve (node:internal/modules/esm/resolve:938:20)
    at defaultResolve (node:internal/modules/esm/resolve:1153:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
    at link (node:internal/modules/esm/module_job:76:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v18.15.0
error Command failed with exit code 1.

Expected behavior

paraglide-js should work in projects that use yarn.

Reproduction

Run the following in an empty directory:

yarn init -y
git init
npx @inlang/paraglide-js@latest init
yarn install

Other information

https://github.com/jldec/yarn-paraglide

@samuelstroschein
Copy link
Member

Great haha. This is an SDK issue (the position we are hiring)

@samuelstroschein samuelstroschein added the scope: inlang/sdk Related to source-code/sdk. label Jan 9, 2024
@GimpMaster
Copy link

Just came here to say this. Saw the same thing. For now I guess I'll just manually add.

yarn version: 1.22.21

@samuelstroschein
Copy link
Member

We should probably drop support for yarn below v3.

  • sveltekit and other libs are dropping support
  • yarn <3 is broken because it deviates from node module resolution
CleanShot 2024-01-25 at 09 45 06@2x

@jldec jldec closed this as completed Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: inlang/sdk Related to source-code/sdk. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants