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

[Question]: Module '"@carbon/react"' has no exported member DataTable (or any other) #13154

Closed
1 task done
valyagolev opened this issue Feb 15, 2023 · 3 comments
Closed
1 task done

Comments

@valyagolev
Copy link

valyagolev commented Feb 15, 2023

Question for Carbon

My app is created using create-react-app. I installed @carbon/react using yarn add, I also installed the sass package. I couldn't understand the "node_modules in sass config" step, but after googling I tried setting SASS_PATH=node_modules env var, which didn't seem to help. Perhaps I missed a step? What else should I have done?

VS Code Typescript plugin highlights the following line as full of errors, each of them says something like Module '"@carbon/react"' has no exported member DataTable. I can still open node_modules/@carbon/react/lib/index.d.ts using "Go to definition", so the file exists (though, "Go to definition" from that file to the components doesn't work). I couldn't find such an error anywhere in the issues of this project.

import {
  DataTable,
  Table,
  TableHead,
  TableRow,
  TableHeader,
  TableBody,
  TableCell,
} from "@carbon/react";

Also if I run:

SASS_PATH=node_modules yarn start

I still get warnings like:

TS2305: Module '"@carbon/react"' has no exported member 'TableHeader'.

But most fascinatingly, the app seems to compile and work and show a DataTable.

Versions are:

    "@carbon/react": "^1.22.0",
    "sass": "^1.58.1",

Code of Conduct

@tay1orjones
Copy link
Member

VS Code Typescript plugin highlights the following line as full of errors

Yeah, this is somewhat of a false error due to only some components having types provided right now. They're slowly being added by the community #12513. This has been reported before and some workarounds listed: #13091

@tay1orjones
Copy link
Member

Duplicate of #13091

@tay1orjones tay1orjones marked this as a duplicate of #13091 Feb 15, 2023
@tay1orjones tay1orjones closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2023
@github-project-automation github-project-automation bot moved this to ✅ Done in Design System Feb 15, 2023
@valyagolev
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants