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

TypeScript errors #1586

Closed
jelhan opened this issue Apr 4, 2024 · 5 comments
Closed

TypeScript errors #1586

jelhan opened this issue Apr 4, 2024 · 5 comments

Comments

@jelhan
Copy link

jelhan commented Apr 4, 2024

We are running into type errors with packages from this repository in ember-math-helpers:

../node_modules/.pnpm/@[email protected]/node_modules/@glimmer/manager/dist/types/lib/public/modifier.d.ts:45:5 - error TS2416: Property 'getTag' in type 'CustomModifierManager<O, ModifierInstance>' is not assignable to the same property in base type 'InternalModifierManager<CustomModifierState<ModifierInstance>, object>'.
  Type '({ tag }: CustomModifierState<ModifierInstance>) => UpdatableTag' is not assignable to type '(modifier: CustomModifierState<ModifierInstance>) => UpdatableTag | null'.
    Type 'MonomorphicTagBase<MonomorphicTagTypes.Updatable>' is missing the following properties from type 'MonomorphicTagBase<MonomorphicTagTypes.Updatable>': [TYPE], [COMPUTE]

45     getTag({ tag }: CustomModifierState<ModifierInstance>): UpdatableTag;
       ~~~~~~
../node_modules/.pnpm/@[email protected]/node_modules/@glimmer/validator/dist/types/lib/validators.d.ts:78:45 - error TS2422: A class can only implement an object type or intersection of object types with statically known members.

78 declare class MonomorphicTagImpl implements MonomorphicTag {
                                               ~~~~~~~~~~~~~~

See RobbieTheWagner/ember-math-helpers#1423 and the failing CI pipeline for reproduction.

Relevant dependencies:

  • typescript: 5.4.3
  • @glimmer/manager: 0.84.2
  • @glimmer/validator: 0.84.2
@NullVoxPopuli
Copy link
Contributor

Looks like you have @glimmer/validator 0.44.0 in your deps, which isn't supported 😅

you can use pnpm.overrides to set a min version of @glimmer/validator.

can you provide the pnpm why @glimmer/validator output?
we should fix whatever is specifying that ancient of a dep

@jelhan
Copy link
Author

jelhan commented Apr 4, 2024

I don't see @glimmer/validator with 0.44.0 in the dependency tree:

$ pnpm why @glimmer/validator
Legend: production dependency, optional only, dev only

[email protected] /home/main/Code/open-source/ember-math-helpers/ember-math-helpers

dependencies:
ember-source 5.2.0
├─┬ @glimmer/manager 0.84.2
│ ├─┬ @glimmer/reference 0.84.2
│ │ └── @glimmer/validator 0.84.2
│ └── @glimmer/validator 0.84.2
├─┬ @glimmer/node 0.84.2
│ └─┬ @glimmer/runtime 0.84.2
│   ├─┬ @glimmer/program 0.84.2
│   │ ├─┬ @glimmer/manager 0.84.2
│   │ │ ├─┬ @glimmer/reference 0.84.2
│   │ │ │ └── @glimmer/validator 0.84.2
│   │ │ └── @glimmer/validator 0.84.2
│   │ └─┬ @glimmer/opcode-compiler 0.84.2
│   │   └─┬ @glimmer/reference 0.84.2
│   │     └── @glimmer/validator 0.84.2
│   ├─┬ @glimmer/reference 0.84.2
│   │ └── @glimmer/validator 0.84.2
│   └── @glimmer/validator 0.84.2
├─┬ @glimmer/opcode-compiler 0.84.2
│ └─┬ @glimmer/reference 0.84.2
│   └── @glimmer/validator 0.84.2
└─┬ @glimmer/program 0.84.2
  └─┬ @glimmer/manager 0.84.2
    ├─┬ @glimmer/reference 0.84.2
    │ └── @glimmer/validator 0.84.2
    └── @glimmer/validator 0.84.2

@NullVoxPopuli
Copy link
Contributor

since you have a monorepo, what's the output of pnpm why @glimmer/validator -r?

@jelhan
Copy link
Author

jelhan commented Apr 4, 2024

since you have a monorepo, what's the output of pnpm why @glimmer/validator -r?

Thanks a lot for that hint. The test app has pulled in @glimmer/validator with 0.44.0 as transitive dependency of @glimmer/tracking with version 1.1.2.

@glimmer/tracking 1.1.2
└── @glimmer/validator 0.44.0

Enforcing @glimmer/tracking to be ^0.84.3 with PNPM overrides fixed that issue.

@NullVoxPopuli
Copy link
Contributor

I opened an issue here: glimmerjs/glimmer.js#413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants