You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v4.x
v5.x
v6.x
Current Behavior
When switch from jest to Vitest, the vite based alternative, i got this error:
SyntaxError: Cannot use import statement outside a module
❯ wrapSafe internal/modules/cjs/loader.js:1001:16
❯ Module._compile internal/modules/cjs/loader.js:1049:27
❯ Object.Module._extensions..js internal/modules/cjs/loader.js:1114:10
❯ Module.load internal/modules/cjs/loader.js:950:32
❯ Function.Module._load internal/modules/cjs/loader.js:790:12
❯ Module.require internal/modules/cjs/loader.js:974:19
❯ require internal/modules/cjs/helpers.js:101:18
❯ Object.<anonymous> node_modules/.pnpm/@ionic+vue@6.1.0/node_modules/@ionic/vue/dist/index.js:6:25
4|
5| const vue = require('vue');
6| const ionAccordion_js = require('@ionic/core/components/ion-accordion.js');
| ^
7| const ionAccordionGroup_js = require('@ionic/core/components/ion-accordion-group.js');
8| const ionAvatar_js = require('@ionic/core/components/ion-avatar.js');
❯ Module._compile internal/modules/cjs/loader.js:1085:14
❯ Object.Module._extensions..js internal/modules/cjs/loader.js:1114:10
Module /Users/martindonadieu/Documents/Projects.nosync/Mimesis/node_modules/.pnpm/@ionic+core@6.1.0/node_modules/@ionic/core/components/ion-accordion.js:4 seems to be an ES Module but shipped in a CommonJS package. You might want to create an issue to the package "@ionic/core" asking them to ship the file in .mjs extension or add "type": "module" in their package.json.
Expected Behavior
Importing ionic should work for vite and vitest without issue
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Prerequisites
Ionic Framework Version
Current Behavior
When switch from jest to Vitest, the vite based alternative, i got this error:
Expected Behavior
Importing ionic should work for vite and vitest without issue
Steps to Reproduce
git clone this app: https://github.com/Forgr-ee/Mimesis/
pnpm i
pnpm test
and you will get the issueCode Reproduction URL
https://github.com/Forgr-ee/Mimesis
Ionic Info
Additional Information
No response
The text was updated successfully, but these errors were encountered: