Skip to content

Module distribution incompatible with upcoming svelte4 release #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cesarnml opened this issue Jun 6, 2023 · 1 comment · Fixed by #221
Closed

Module distribution incompatible with upcoming svelte4 release #220

cesarnml opened this issue Jun 6, 2023 · 1 comment · Fixed by #221
Labels

Comments

@cesarnml
Copy link

cesarnml commented Jun 6, 2023

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

  1. Git clone above repo.
  2. pnpm i
  3. 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/@[email protected][email protected]/node_modules/svelte/package.json
 ❯ Object.<anonymous> node_modules/.pnpm/@[email protected][email protected]/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

@github-actions
Copy link

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant