-
Notifications
You must be signed in to change notification settings - Fork 106
Description
Describe the bug
- Cannot find module '@ui5/webcomponents-react-base/Device' from 'node_modules/@ui5/webcomponents-react/dist/components/AnalyticalTable/hooks/useCanUseVoiceOver.js'
- cannot find module '@ui5/webcomponents-react-base/internal/utils' from 'node_modules/@ui5/webcomponents-react/dist/components/ActionSheet/index.js'
- Cannot find module '@ui5/webcomponents-react-base/internal/hooks' from 'node_modules/@ui5/webcomponents-react/dist/components/AnalyticalTable/scrollbars/VerticalScrollbar.js'
So as a workaround each project need to update jest.config.js
// Workaround for UI5 WebComponents React v2.16.0 bugs
jestConfig.moduleNameMapper = {
...jestConfig.moduleNameMapper,
"@ui5/webcomponents-react-base/Device": "@ui5/webcomponents-react-base/dist/Device", // Cannot find module '@ui5/webcomponents-react-base/Device' from 'node_modules/@ui5/webcomponents-react/dist/components/AnalyticalTable/hooks/useCanUseVoiceOver.js'
"@ui5/webcomponents-react-base/internal/utils": "@ui5/webcomponents-react-base", // Cannot find module '@ui5/webcomponents-react-base/internal/utils' from 'node_modules/@ui5/webcomponents-react/dist/components/ActionSheet/index.js'
"@ui5/webcomponents-react-base/internal/hooks": "@ui5/webcomponents-react-base" // Cannot find module '@ui5/webcomponents-react-base/internal/hooks' from 'node_modules/@ui5/webcomponents-react/dist/components/AnalyticalTable/scrollbars/VerticalScrollbar.js'
};
Isolated Example
No response
Reproduction steps
- Upgrade to "@ui5/webcomponents": "2.16.1" (and others), and "@ui5/webcomponents-react": "2.16.0",
- npm run test
Get below errors:
- Cannot find module '@ui5/webcomponents-react-base/Device' from 'node_modules/@ui5/webcomponents-react/dist/components/AnalyticalTable/hooks/useCanUseVoiceOver.js'
- cannot find module '@ui5/webcomponents-react-base/internal/utils' from 'node_modules/@ui5/webcomponents-react/dist/components/ActionSheet/index.js'
- Cannot find module '@ui5/webcomponents-react-base/internal/hooks' from 'node_modules/@ui5/webcomponents-react/dist/components/AnalyticalTable/scrollbars/VerticalScrollbar.js'
Expected Behaviour
No js error and no workaround should be applied to jest.config.js
Screenshots or Videos
No response
UI5 Web Components for React Version
2.16.0
UI5 Web Components Version
2.16.1
Browser
Chrome
Operating System
No response
Additional Context
No response
Relevant log output
Organization
No response
Declaration
- I’m not disclosing any internal or sensitive information.