siemens / ix

Siemens Industrial Experience is a design system for designers and developers, to consistently create the perfect digital experience for industrial software products.
https://ix.siemens.io/
MIT License
197 stars 65 forks source link

React: Visibility Issue with IX Icons on Production Build #1063

Closed rkoszo closed 1 month ago

rkoszo commented 8 months ago

Prerequisites

What happened?

We've recently transitioned to IX, but we've encountered a problem. Unfortunately, we are facing a challenge as the IX icons are not visible on our production build. Interestingly, during my investigation, I found that Font Awesome and MUI icons are displaying correctly. I have been experimenting with various approaches to resolve this issue, but the IX icons remain the same.

Here are the environment details for your reference: • Operating System: Debian • Node Versions: 18.16.0 / 20.10.0 / 20.11.0 • React Version: 18.2.0 • @siemens/ix-icons Versions: 2.0.0 / 2.1.0 • @siemens/ix-react Version: 2.0.4 • Bundler: Rollup / SWC

Thank you in advance.

What type of frontend frameware are you seeing the problem on?

React

Which version of iX do you use?

2.0.4

Code to produce this issue.

I can send our repository or a build in private
danielleroux commented 8 months ago

Temporary workaround would be to define the icon component before you bootstrap the framework.

e.g

import { defineCustomElements } from '@siemens/ix-icons/loader';

defineCustomElements().then(() => {
    const root = createRoot(document.getElementById('app'));
    root.render(<h1>Hello, world</h1>);
})
matthiashader commented 7 months ago

Internal ref [IX-876]

hoeflerjo commented 7 months ago

I also face this issue.

It is really weird that the issue only arrises for me when using a production build on my Linux system and in no other constellation.

I would assume the build output for node.js projects is completly OS independent. Therefore I don't understand why the issue appers on Debian (maybe all Linux distros). It also appers not to be caused by the Framework as we tested it on Windows and Linux using Flask and Django, which should also be Platform independent.

danielleroux commented 4 months ago

Looks like the issue is solved within latest release v2.2.0 do can confirm this inside your setup?