Open
Description
What version of strapi-design-system are you using?
1.12.2
What's Wrong?
vitest consumes mjs bundles which throw these type of errors
more info: https://github.com/vitest-dev/vitest/discussions/4233types
To Reproduce
Unit test a component containing a SimpleMenu
or a Combobox
Expected Behaviour
The design system should be testable using vitest library.
At the moment this issue can be bypassed by updating the export
section of the package to use only js
files, and not mjs
. But it seems an ugly workaround that could damage other consumers of the design system
from
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"default": "./dist/index.js"
},
"./v2": {
"types": "./dist/v2/index.d.ts",
"import": "./dist/v2/index.mjs",
"require": "./dist/v2/index.js",
"default": "./dist/v2/index.js"
},
"./*": "./dist/*"
},
to
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.js",
"default": "./dist/index.js"
},
"./v2": {
"types": "./dist/v2/index.d.ts",
"import": "./dist/v2/index.js",
"require": "./dist/v2/index.js",
"default": "./dist/v2/index.js"
},
"./*": "./dist/*"
},