Closed umar-shabbir closed 3 months ago
Please provide a repository (github) which shows the behavior.
Please provide a repository (github) which shows the behavior.
@danielleroux I have updated the issue with link to repository
Its part of our sprint roadmap for v3. Removing commonjs will result in a breaking change.
[Ix-956]
Its part of our sprint roadmap for v3. Removing commonjs will result in a breaking change.
[Ix-956]
Thanks @danielleroux. Can you suggest me any alternate solution for now? Do I need to try some other test runner? I want to test my components (which depend on ix components) using React Testing Library. To run these tests, I need a test runner and Vitest didn't work as mentioned. I also could not make Jest work with Ix. Similar error appears with Jest too:
SyntaxError: Cannot use import statement outside a module
1 | import { useState } from 'react';
> 2 | import {
| ^
3 | IxButton,
4 | IxIconButton,
5 | IxContentHeader,
For jest we added the following to package.json:
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!(@siemens|@stencil))"
]
}
Hello, I work for Siemens and have the same problem with the same import. We use react on a nextjs project and when I updated from version 1.6.3
to 2.1.1
it had a problem when compiling:
.../node_modules/@siemens/ix/components/ix-action-card.js:1 import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
is there any solution to this?
Prerequisites
What happened?
Unable to use Vitest for running tests in my react app.
@siemens/ix-react
is added independencies
of this app. When running test with Vitest, it gives following error:"Module ix-action-card seems to be an ES Module but shipped in a CommonJS package. You might want to create an issue to the package "@siemens/ix" asking them to ship the file in .mjs extension or add "type": "module" in their package.json"
What type of frontend frameware are you seeing the problem on?
React
Which version of iX do you use?
v2.1.0
Code to produce this issue.
npm install
npm run test