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

Cannot build with yarn #578

Closed
hyperknot opened this issue Apr 23, 2018 · 1 comment
Closed

Cannot build with yarn #578

hyperknot opened this issue Apr 23, 2018 · 1 comment

Comments

@hyperknot
Copy link

hyperknot commented Apr 23, 2018

I'm trying to run yarn build and yarn start in the examples folder but none of them works.

  1. Git clone master (or checkout 3.8.0 tag)
  2. yarn, OK
  3. yarn build terminates in:
Test Suites: 12 passed, 12 total
Tests:       48 passed, 48 total
Snapshots:   0 total
Time:        4.291s
Ran all test suites.


node_modules/@types/enzyme/node_modules/@types/react/index.d.ts(2250,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'a' must be of type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>', but here has type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>'.
node_modules/@types/enzyme/node_modules/@types/react/index.d.ts(2251,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'abbr' must be of type 'DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>', but here has type 'DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>'.

And about a hundred or so occurrences afterwards. Ending with

  Named property 'ref' of types 'ClassAttributes<T>' and 'ClassAttributes<T>' are not identical.
src/cluster.tsx(129,21): error TS2345: Argument of type '{ clusterPoints: Cluster[]; }' is not assignable to parameter of type 'State | ((prevState: Readonly<State>, props: Props) => State | Pick<State, "clusterPoints">) | Pi...'.
  Type '{ clusterPoints: Cluster[]; }' is not assignable to type 'Pick<State, "clusterPoints">'.
    Types of property 'clusterPoints' are incompatible.
      Type 'Cluster[]' is not assignable to type 'Feature<Point>[]'.
        Type 'Cluster' is not assignable to type 'Feature<Point>'.
          Types of property 'id' are incompatible.
            Type 'string | number | undefined' is not assignable to type 'string | undefined'.
              Type 'number' is not assignable to type 'string | undefined'.
src/cluster.tsx(175,49): error TS2345: Argument of type 'Cluster[]' is not assignable to parameter of type 'Feature<any>[]'.
  Type 'Cluster' is not assignable to type 'Feature<any>'.
    Types of property 'id' are incompatible.
      Type 'string | number | undefined' is not assignable to type 'string | undefined'.
        Type 'number' is not assignable to type 'string | undefined'.
error Command failed with exit code 2.

If I go to examples and run yarn; yarn start, similar errors appear, ending with:

ERROR in ./src/root.tsx
(73,22): error TS2339: Property 'selected' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<ThemedOuterStyledProps<{ children?: Reac...'.

ERROR in ./src/root.tsx
(74,22): error TS2339: Property 'selected' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<ThemedOuterStyledProps<{ children?: Reac...'.
webpack: Failed to compile.

OS: macOS 10.13.4
node: v8.9.4
yarn: 1.6.0

When using npm (5.6.0) instead of yarn this error is not present.

@hyperknot hyperknot changed the title Cannot build Build terminates in errors Apr 23, 2018
@hyperknot hyperknot changed the title Build terminates in errors Cannot build with yarn Apr 23, 2018
@mklopets
Copy link
Collaborator

In general, when a project is already using one or the other (i.e npm or yarn), you should use that same one to do installs (and preferably run builds and other commands, too). One of the reasons being that lockfiles from one aren't (necessarily) respected by the other(s). Closing this issue.

Discussion on competing lockfiles: yarnpkg/yarn#5654

BTW, I use yarn in all my other projects but npm for stuff related to this. It's not that bad.

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