microsoft / fast

The adaptive interface system for modern web experiences.
https://www.fast.design
Other
9.29k stars 599 forks source link

Errors during installation #6619

Closed YonatanKra closed 6 months ago

YonatanKra commented 1 year ago

Hi, I'm trying to set up the repository locally to contribute a PR but running into installation issues.

I've forked and cloned the repository, ensuring the fork is synced with the upstream.

Note that I'm working on the archives/fast-element-1 branch.

When I run yarn install with node 18, I get the following error on the prepare (post install) phase:

lerna ERR! yarn run prepare stderr:

src/index-rollup.ts → temp/index-rollup.js...
[!] (plugin rpt2) Error: /Users/YKra/projects/open-source/fast/sites/fast-website/src/app/components/color-swatch/color-swatch.styles.ts(27,50): semantic error TS2345: Argument of type 'CSSDesignToken<number>' is not assignable to parameter of type 'ComposableStyles | CSSDirective'.
  Type 'CSSDesignToken<number>' is not assignable to type 'CSSDirective'.
    The types returned by 'createCSS()' are incompatible between these types.
      Type 'import("/Users/YKra/projects/open-source/fast/node_modules/@microsoft/fast-components/node_modules/@microsoft/fast-element/dist/fast-element").ComposableStyles' is not assignable to type 'import("/Users/YKra/projects/open-source/fast/node_modules/@microsoft/fast-element/dist/fast-element").ComposableStyles'.
        Type 'ElementStyles' is not assignable to type 'ComposableStyles'.
          Type 'import("/Users/YKra/projects/open-source/fast/node_modules/@microsoft/fast-components/node_modules/@microsoft/fast-element/dist/fast-element").ElementStyles' is not assignable to type 'import("/Users/YKra/projects/open-source/fast/node_modules/@microsoft/fast-element/dist/fast-element").ElementStyles'.
            Types have separate declarations of a private property 'targets'.
src/app/components/color-swatch/color-swatch.styles.ts
Error: /Users/YKra/projects/open-source/fast/sites/fast-website/src/app/components/color-swatch/color-swatch.styles.ts(27,50): semantic error TS2345: Argument of type 'CSSDesignToken<number>' is not assignable to parameter of type 'ComposableStyles | CSSDirective'.
  Type 'CSSDesignToken<number>' is not assignable to type 'CSSDirective'.
    The types returned by 'createCSS()' are incompatible between these types.
      Type 'import("/Users/YKra/projects/open-source/fast/node_modules/@microsoft/fast-components/node_modules/@microsoft/fast-element/dist/fast-element").ComposableStyles' is not assignable to type 'import("/Users/YKra/projects/open-source/fast/node_modules/@microsoft/fast-element/dist/fast-element").ComposableStyles'.
        Type 'ElementStyles' is not assignable to type 'ComposableStyles'.
          Type 'import("/Users/YKra/projects/open-source/fast/node_modules/@microsoft/fast-components/node_modules/@microsoft/fast-element/dist/fast-element").ElementStyles' is not assignable to type 'import("/Users/YKra/projects/open-source/fast/node_modules/@microsoft/fast-element/dist/fast-element").ElementStyles'.
            Types have separate declarations of a private property 'targets'.
    at error (/Users/YKra/projects/open-source/fast/node_modules/rollup/dist/shared/rollup.js:198:30)
    at throwPluginError (/Users/YKra/projects/open-source/fast/node_modules/rollup/dist/shared/rollup.js:21902:12)
    at Object.error (/Users/YKra/projects/open-source/fast/node_modules/rollup/dist/shared/rollup.js:22625:20)
    at Object.error (/Users/YKra/projects/open-source/fast/node_modules/rollup/dist/shared/rollup.js:22079:42)
    at RollupContext.error (/Users/YKra/projects/open-source/fast/node_modules/rollup-plugin-typescript2/src/rollupcontext.ts:37:18)
    at /Users/YKra/projects/open-source/fast/node_modules/rollup-plugin-typescript2/src/print-diagnostics.ts:41:11
    at arrayEach (/Users/YKra/projects/open-source/fast/node_modules/rollup-plugin-typescript2/node_modules/lodash/lodash.js:516:11)
    at Function._.each [as forEach] (/Users/YKra/projects/open-source/fast/node_modules/rollup-plugin-typescript2/node_modules/lodash/lodash.js:9368:14)
    at printDiagnostics (/Users/YKra/projects/open-source/fast/node_modules/rollup-plugin-typescript2/src/print-diagnostics.ts:9:2)
    at Object.transform (/Users/YKra/projects/open-source/fast/node_modules/rollup-plugin-typescript2/src/index.ts:242:5)

I then switched to node 16 and got the following error:

$ tsc -p ./tsconfig.json
../../node_modules/@microsoft/fast-tooling/node_modules/@microsoft/fast-foundation/dist/fast-foundation.d.ts(4813,61): error TS2677: A type predicate's type must be assignable to its parameter's type.
  Type 'ListboxOption' is missing the following properties from type 'Element': attributes, classList, className, clientHeight, and 149 more.
../../node_modules/@microsoft/fast-tooling/node_modules/@microsoft/fast-foundation/dist/fast-foundation.d.ts(6851,22): error TS2420: Class 'Radio' incorrectly implements interface 'RadioControl'.
  Type 'Radio' is missing the following properties from type 'RadioControl': focus, getAttribute, setAttribute
../../node_modules/@microsoft/fast-tooling/node_modules/@microsoft/fast-foundation/dist/fast-foundation.d.ts(7054,59): error TS2344: Type 'T' does not satisfy the constraint 'abstract new (...args: any) => any'.
../../node_modules/@microsoft/fast-tooling/node_modules/@microsoft/fast-foundation/dist/fast-foundation.d.ts(7116,95): error TS2344: Type 'T_1' does not satisfy the constraint 'abstract new (...args: any) => any'.
../../node_modules/@microsoft/fast-tooling/node_modules/@microsoft/fast-foundation/dist/fast-foundation.d.ts(7129,95): error TS2344: Type 'T_2' does not satisfy the constraint 'abstract new (...args: any) => any'.
../../node_modules/@microsoft/fast-tooling/node_modules/@microsoft/fast-foundation/dist/fast-foundation.d.ts(7210,115): error TS2344: Type 'K' does not satisfy the constraint 'abstract new (...args: any) => any'.
../../node_modules/@microsoft/fast-tooling/node_modules/@microsoft/fast-foundation/dist/fast-foundation.d.ts(7210,200): error TS2344: Type 'T1' does not satisfy the constraint 'abstract new (...args: any) => any'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run prepare stderr:

build/src/generate-component-schemas.js → build/artifacts/generate-component-schemas-built.js...
created build/artifacts/generate-component-schemas-built.js in 2.3s
error Command failed with exit code 2.

Anyone else experiences this issue?

chrisdholt commented 1 year ago

Just a heads up that this is the issue I mentioned in the other issue. Unfortunately haven’t been able to resolve it. I believe it has to do with a nested dependency on fast tooling old version.

YonatanKra commented 1 year ago

I'm trying to run the foundation's tests. Some of the tests fail locally (without any change on my part). Updating the files seems to have no effect once I run the tests once. Is there some caching mechanism involved? Do I need to build before running the tests? Ok, figured out that last bit. It works with yarn tdd. Tests for RTL are still failing locally but it is less concerning right now :)