question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: @carbon/icons-react : icon import error

See original GitHub issue

Package

@carbon/icons-react

Browser

Chrome

Package version

10.49.0 & 10.48.0

React version

17.0.2

Description

There is a problem that icons that do not require size specification (ex. status shap icon) are not imported properly.

Am I using it wrong?

import { CircleFillGlyph } from '@carbon/icons-react'

Screen Shot 2022-03-26 at 11 45 40 PM

CodeSandbox example

https://codesandbox.io/s/github/carbon-design-system/carbon/tree/main/packages/react/examples/codesandbox?file=/src/index.js

Steps to reproduce

There is no error in the code above.

However, there is a problem that the import does not work properly in my current project.

This is my package.json dependencies Screen Shot 2022-03-26 at 11 59 32 PM

Code of Conduct

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
joshblackcommented, Apr 5, 2022

@JWLK ah okay, thanks so much for the link! It may be that this icon is unavailable in the types for the package that come from DefinitelyTyped. Unfortunately, the TypeScript types for this package are community-maintained and are not something that we support at the moment.

0reactions
joshblackcommented, Apr 13, 2022

Great questions, the latest for TypeScript will come up in this discussion: https://github.com/carbon-design-system/carbon/discussions/10752

At the moment, we definitely are relying on community contributions over in DefinitelyTyped. I believe that there is interest in maintaining TypeScript types in the future but there is no clear roadmap or plan for that at the moment.

Hope this helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug]: SolarPanel32 icon is missing · Issue #10378
Import the icon like other carbon icons import {SolarPanel32} from '@carbon/icons-react'; , then following error comes Uncaught ...
Read more >
Dynamic Import / Code Splitting inside a Library that is ...
The problem occurs when I try to import the Icon component in another ... They are at the same location that the error...
Read more >
Icons – Carbon Design System
To install @carbon/icons-react in your project, you will need to run the following ... Icons in this package can be accessed through importing...
Read more >
carbon/icons-react - npm Package Health Analysis
You can import an icon component intoo your project by referring to its name: import { Add } from '@carbon/icons-react';.
Read more >
an error occurred while insert icon in microsoft office - TechNet
Hi JYser,. Did this problem appear in all files when trying to import to Office? How did you import files? I suggest you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found