Skip to content
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

fix(testing): Use .mjs for esm exports #3270

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

gcascio
Copy link
Contributor

@gcascio gcascio commented Apr 26, 2024

Description

ESM imports from the testing package currently fail with e.g.

SyntaxError: The requested module '@clerk/testing/playwright' does not provide an export named 'clerkSetup'

A reproduction can be found here which is a clone of the official clerk example changed to type: "module".

This PR removes the legacyOutput flag from the tsup config and instead exports ESM modules with the .mjs extension.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented Apr 26, 2024

🦋 Changeset detected

Latest commit: 2b27f0a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@anagstef
Copy link
Member

Thank you for your contribution and detailed PR description. 🙏

@anagstef
Copy link
Member

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @anagstef - the snapshot version command generated the following package versions:

Package Version
@clerk/backend 1.1.0-snapshot.v4c5edbc
@clerk/chrome-extension 1.0.2-snapshot.v4c5edbc
@clerk/clerk-js 5.1.1-snapshot.v4c5edbc
@clerk/clerk-expo 1.0.2-snapshot.v4c5edbc
@clerk/express 0.0.3-snapshot.v4c5edbc
@clerk/fastify 1.0.2-snapshot.v4c5edbc
gatsby-plugin-clerk 5.0.0-beta.45
@clerk/nextjs 5.0.3-snapshot.v4c5edbc
@clerk/remix 4.0.2-snapshot.v4c5edbc
@clerk/clerk-sdk-node 5.0.2-snapshot.v4c5edbc
@clerk/testing 1.0.1-snapshot.v4c5edbc

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/backend

npm i @clerk/backend@1.1.0-snapshot.v4c5edbc --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@1.0.2-snapshot.v4c5edbc --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.1.1-snapshot.v4c5edbc --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@1.0.2-snapshot.v4c5edbc --save-exact

@clerk/express

npm i @clerk/express@0.0.3-snapshot.v4c5edbc --save-exact

@clerk/fastify

npm i @clerk/fastify@1.0.2-snapshot.v4c5edbc --save-exact

gatsby-plugin-clerk

npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@5.0.3-snapshot.v4c5edbc --save-exact

@clerk/remix

npm i @clerk/remix@4.0.2-snapshot.v4c5edbc --save-exact

@clerk/clerk-sdk-node

npm i @clerk/clerk-sdk-node@5.0.2-snapshot.v4c5edbc --save-exact

@clerk/testing

npm i @clerk/testing@1.0.1-snapshot.v4c5edbc --save-exact

@anagstef anagstef self-assigned this Apr 26, 2024
Copy link
Member

@anagstef anagstef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! 💯 Thank you! 🙏

@nikosdouvlis nikosdouvlis merged commit d921bfa into clerk:main Apr 26, 2024
5 of 10 checks passed
@clerk-cookie clerk-cookie mentioned this pull request Apr 26, 2024
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 this pull request may close these issues.

4 participants