Skip to content

Conversation

@wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Sep 9, 2024

Description

This small PR pre-bundles @clerk/astro/client to ensure proper processing of <script> tags and nanostore imports in our exported control components. This resolves runtime issues in development when these components are used in other projects.

Resolves ECO-188

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:

@changeset-bot
Copy link

changeset-bot bot commented Sep 9, 2024

🦋 Changeset detected

Latest commit: 4962cd4

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

This PR includes changesets to release 1 package
Name Type
@clerk/astro 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

// which uses <script> tags and imports nanostores will not be processed by Astro.
// This ensures @clerk/astro/client is properly processed and bundled,
// resolving runtime import issues in these components.
config.optimizeDeps?.include?.push('@clerk/astro/client');
Copy link
Member Author

@wobsoriano wobsoriano Sep 9, 2024

Choose a reason for hiding this comment

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

More info on how Astro processes <script> tags here.

The @clerk/astro/client export is imported by our control components, but Astro is not able to process it. Adding it to optimizeDeps.include will force astro to process it.

@wobsoriano wobsoriano merged commit 4020ead into main Sep 10, 2024
@wobsoriano wobsoriano deleted the rob/eco-188-investigate-why-csr-control-components-are-not-rendering branch September 10, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants