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

Some errors with latest webpack #678

Open
olegshilov opened this issue Feb 8, 2021 · 0 comments
Open

Some errors with latest webpack #678

olegshilov opened this issue Feb 8, 2021 · 0 comments

Comments

@olegshilov
Copy link
Contributor

Hello. I'm trying to use the latest beta astroturf release but faced some errors.
I use the latest webpack and yarn 2 with pnp and workspaces endbled.

Trying to use a simple styled button component from readme.md.
https://github.com/olegshilov/yarn-2-typescript-webpack-example/blob/main/packages/workspace-b/src/components/StyledComponents.tsx#L3

I have a minimal repository to reproduce this behavior https://github.com/olegshilov/yarn-2-typescript-webpack-example
Can someone please tell me what I'm doing wrong?

ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/ComponentUsesBP.tsx
../workspace-b/src/components/ComponentUsesBP.tsx
[tsl] ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/ComponentUsesBP.tsx(14,6)
      TS2786: 'SimpleContainer' cannot be used as a JSX component.
  Its return type 'StyledComponent<"div", {}, never>' is not a valid JSX element.
    Type 'StyledComponent<"div", {}, never>' is missing the following properties from type 'Element': type, props, key
 @ ../workspace-b/src/index.ts 14:13-52
 @ ./src/components/Root.tsx 9:22-44
 @ ./src/index.tsx 8:15-43

ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/ComponentUsesBP.tsx
../workspace-b/src/components/ComponentUsesBP.tsx
[tsl] ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/ComponentUsesBP.tsx(21,8)
      TS2786: 'AstroturfButton' cannot be used as a JSX component.
  Its return type 'StyledComponent<"button", {}, never>' is not a valid JSX element.
    Type 'StyledComponent<"button", {}, never>' is missing the following properties from type 'Element': type, props, key
 @ ../workspace-b/src/index.ts 14:13-52
 @ ./src/components/Root.tsx 9:22-44
 @ ./src/index.tsx 8:15-43

ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/StyledComponents.tsx
../workspace-b/src/components/StyledComponents.tsx
[tsl] ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/StyledComponents.tsx(6,68)
      TS2554: Expected 1-2 arguments, but got 3.
 @ ../workspace-b/src/components/ComponentUsesBP.tsx 10:27-56
 @ ../workspace-b/src/index.ts 14:13-52
 @ ./src/components/Root.tsx 9:22-44
 @ ./src/index.tsx 8:15-43

ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/StyledComponents.tsx
../workspace-b/src/components/StyledComponents.tsx
[tsl] ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/StyledComponents.tsx(8,11)
      TS2693: '_AstroturfButton' only refers to a type, but is being used as a value here.
 @ ../workspace-b/src/components/ComponentUsesBP.tsx 10:27-56
 @ ../workspace-b/src/index.ts 14:13-52
 @ ./src/components/Root.tsx 9:22-44
 @ ./src/index.tsx 8:15-43

ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/StyledComponents.tsx
../workspace-b/src/components/StyledComponents.tsx
[tsl] ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/StyledComponents.tsx(11,65)
      TS2554: Expected 1-2 arguments, but got 3.
 @ ../workspace-b/src/components/ComponentUsesBP.tsx 10:27-56
 @ ../workspace-b/src/index.ts 14:13-52
 @ ./src/components/Root.tsx 9:22-44
 @ ./src/index.tsx 8:15-43

ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/StyledComponents.tsx
../workspace-b/src/components/StyledComponents.tsx
[tsl] ERROR in /Users/olegshilov/Documents/yarn-workspaces-pnp-typescript-webpack-react/packages/workspace-b/src/components/StyledComponents.tsx(13,11)
      TS2693: '_SimpleContainer' only refers to a type, but is being used as a value here.
 @ ../workspace-b/src/components/ComponentUsesBP.tsx 10:27-56
 @ ../workspace-b/src/index.ts 14:13-52
 @ ./src/components/Root.tsx 9:22-44
 @ ./src/index.tsx 8:15-43

webpack 5.21.2 compiled with 6 errors in 722 ms
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

1 participant