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

minimal-blog: Property 'sx' does not exist on type #401

Closed
SOHELAHMED7 opened this issue May 13, 2020 · 2 comments
Closed

minimal-blog: Property 'sx' does not exist on type #401

SOHELAHMED7 opened this issue May 13, 2020 · 2 comments
Labels
type: upstream Outside of our control

Comments

@SOHELAHMED7
Copy link

SOHELAHMED7 commented May 13, 2020

Description

On a fresh install of minimal-blog theme, when I shadow a file (e.g. footer.tsx) that have sx property of component, VS code shows me error:

(JSX attribute) sx: {
    my: number;
}
Type '{ children: Element; sx: { my: number; }; }' is not assignable to type 'DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>'.
  Property 'sx' does not exist on type 'DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>'.ts(2322)

This error is shown in VS code and not in CLI during develop or build command

File snippet:

<footer
      sx={{
        boxSizing: `border-box`,
        display: `flex`,
        justifyContent: `space-between`,
        mt: [6],
        color: `secondary`,
        a: {
          variant: `links.secondary`,
        },
        flexDirection: [`column`, `column`, `row`],
        variant: `dividers.top`,
      }}
    >

I solve this issue by npm i @types/theme-ui (satminav/support#3) but it gives me other error on line like import { jsx, Link } from "theme-ui";. So I removed package @types/theme-ui

Steps to reproduce

Download and install fresh gatsby minimal blog theme and showdow any file (e.g. footer.tsx) that have sx property on component

Expected result

Error should not be produced

Actual result

Error is produced

Environment

Run gatsby info --clipboard in your project directory and paste the output here.

  System:
    OS: Linux 4.15 Ubuntu 18.04    
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 11.14.0 - ~/.nvm/versions/node/v11.14.0/bin/node
    Yarn: 1.21.1 - /usr/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v11.14.0/bin/npm
  Languages:
    Python: 2.7.17 - /usr/bin/python
  Browsers:
    Chrome: 81.0.4044.129
    Firefox: 75.0
  npmPackages:
    gatsby: ^2.20.36 => 2.21.9
    gatsby-cli: ^2.12.17 => 2.12.18
    gatsby-plugin-google-analytics: ^2.1.4 => 2.3.0
    gatsby-plugin-manifest: ^2.2.3 => 2.4.1
    gatsby-plugin-netlify: ^2.1.3 => 2.3.0
    gatsby-plugin-offline: ^2.2.4 => 2.2.10
    gatsby-plugin-sitemap: ^2.2.19 => 2.4.1
  npmGlobalPackages:
    gatsby-cli: 2.12.7

@SOHELAHMED7 SOHELAHMED7 added the type: bug An issue or pull request relating to a bug label May 13, 2020
@LekoArts LekoArts added type: upstream Outside of our control and removed type: bug An issue or pull request relating to a bug labels May 14, 2020
@LekoArts
Copy link
Owner

Thank you for opening this!

This isn't related to the theme itself but rather that Theme UI doesn't ship with the correct types yet and your VS Code seems to have TypeScript checker on or something. For now you'll need to ignore those errors until Theme UI ships with its correct types :)

We're marking this issue as answered and closing it for now but please feel free to comment here if you would like to continue this discussion. We also recommend heading over to our communities if you have questions that are not bug reports or feature requests. We hope we managed to help and thank you for using Gatsby!

@SOHELAHMED7
Copy link
Author

Is there any gatsby forum?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: upstream Outside of our control
Projects
None yet
Development

No branches or pull requests

2 participants