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] <title>Failing installation of @roots/bud-typescript with typescript 5 #2216

Closed
3 tasks done
elliason opened this issue Apr 8, 2023 · 3 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@elliason
Copy link

elliason commented Apr 8, 2023

Agreement

Describe the issue

I have a package that uses Bud and bud-typescript. I use Yarn 1 (1.22.17), Node 18 (18.15.0) and Ubuntu 22.04.2 LTS.
The problem is that I cannot install bud-typescript together with typescript@^5. Installation works with typescript@^4 bud version 5 seems to cause troubles.
The error essage: An unexpected error occurred: "could not find a copy of typescript to link in /.../theme/node_modules/@roots/bud-typescript/node_modules"
The issue is reproducible with empty package only containing typescript and bud-typescript
image

Expected Behavior

It should install bud-typescript along with typescript ^5 without problems

Actual Behavior

image

Steps To Reproduce

  1. yarn init
  2. yarn add typescript
  3. yarn add @roots/bud-typescript -D

version

6.12.0

Logs

No response

Configuration

No response

Relevant .budfiles

No response

@elliason elliason added the bug Something isn't working label Apr 8, 2023
@kellymears
Copy link
Member

Can you try manually flushing the cache?

yarn bud build --force

I think this is likely a cache issue with bud.js' resolver (it's still trying to resolve ts from the nested node_modules dir).

I'll look into why the cache isn't being flushed as it should be cleared out by package.json edits. I'm almost positive that's what's happening.

@kellymears
Copy link
Member

It is not what I thought at all. Cache is fine.

This is a bug in yarn v1: yarnpkg/yarn#6285.

#2222 should sidestep it.

For now you can add typescript to your resolutions field using the CLI or adding it to package.json directly:

{
  "resolutions": {
    "typescript": "5.0.4"
  }
}

kodiakhq bot pushed a commit that referenced this issue Apr 20, 2023
Fixes installation issue with custom TypeScript versions.

## Ref

- #2216

## Type of change

**PATCH: backwards compatible change**
kodiakhq bot pushed a commit that referenced this issue Apr 20, 2023
We don't need to declare peer dependencies here because `resolve` and `import` from the extensions API (and `bud.module`) will always privilege dependencies as described in the project `package.json`.

Sidesteps a bug in yarn v1 and improves compatibility with pnpm.

## Related

- #2222
- #2216

## Type of change

**PATCH: backwards compatible change**
kodiakhq bot pushed a commit that referenced this issue Apr 20, 2023
## References

- #2224 
- #2222
- #2216

## Type of change

**PATCH: backwards compatible change**
@kellymears
Copy link
Member

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
None yet
Development

No branches or pull requests

2 participants