Closed
Description
Describe the bug
@testing-library/svelte tests crash on upgrading to [svelte4].(https://www.npmjs.com/package/svelte/v/4.0.0-next.0).
Reproduction
Minimal Example Repo:
https://github.com/cesarnml/svelte4-testing-example
- Git clone above repo.
pnpm i
pnpm test:unit
Logs
FAIL src/routes/page.spec.ts [ src/routes/page.spec.ts ]
Error: No "exports" main defined in /Users/cesar/code/svelte4-testing-example/node_modules/.pnpm/@testing-library+svelte@3.2.2_svelte@4.0.0-next.0/node_modules/svelte/package.json
❯ Object.<anonymous> node_modules/.pnpm/@testing-library+svelte@3.2.2_svelte@4.0.0-next.0/node_modules/@testing-library/svelte/dist/pure.js:28:15
Serialized Error: {
"code": "ERR_PACKAGE_PATH_NOT_EXPORTED",
}
Recommendation:
My recommendation would be that they remove the babel build step which should not be necessary and add "type": "module". Given that its for testing Svelte libraries, they should only need an ESM version and probably shouldn't be distributing it as CJS @benmccann