Skip to content

Conversation

@panteliselef
Copy link
Contributor

@panteliselef panteliselef commented Apr 16, 2025

Description

Replaces #5509 and unblocks #5476

Checklist

  • pnpm test runs as expected.
  • pnpm 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:

@vercel
Copy link

vercel bot commented Apr 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 16, 2025 10:39am

@changeset-bot
Copy link

changeset-bot bot commented Apr 16, 2025

🦋 Changeset detected

Latest commit: a30fa4b

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

This PR includes changesets to release 19 packages
Name Type
@clerk/nextjs Patch
@clerk/shared Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/elements Patch
@clerk/expo-passkeys Patch
@clerk/clerk-expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/vue 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

Comment on lines +68 to +70
try {
await window.__clerk_script_promise;
} catch {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reviewers

That whole block was required, because the browser would console an error for uncaught promise. We are catching the promise inside loadClerkJsScript from @clerk/shared but this code is usually bundled with the main chunk of the nextjs host application which takes significantly longer to load.

const Script = props.router === 'app' ? 'script' : NextScript;

return (
<Script
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you know if nonce needs to be passed here as well, and not just to the script we generate below ?

Copy link
Member

@jacekradko jacekradko Apr 16, 2025

Choose a reason for hiding this comment

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

For a strict-dynamic CSP with a script-src 'nonce-****' value specified, yes, all inline scripts would need to have the nonce attribute, or they will be blocked

@panteliselef
Copy link
Contributor Author

!snapshot

@clerk-cookie
Copy link
Collaborator

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

Package Version
@clerk/agent-toolkit 0.0.23-snapshot.v20250416104815
@clerk/astro 2.6.5-snapshot.v20250416104815
@clerk/backend 1.29.0-snapshot.v20250416104815
@clerk/chrome-extension 2.2.30-snapshot.v20250416104815
@clerk/clerk-js 5.61.1-snapshot.v20250416104815
@clerk/elements 0.23.15-snapshot.v20250416104815
@clerk/clerk-expo 2.9.13-snapshot.v20250416104815
@clerk/expo-passkeys 0.2.7-snapshot.v20250416104815
@clerk/express 1.4.6-snapshot.v20250416104815
@clerk/fastify 2.2.6-snapshot.v20250416104815
@clerk/localizations 3.13.11-snapshot.v20250416104815
@clerk/nextjs 6.15.1-snapshot.v20250416104815
@clerk/nuxt 1.5.6-snapshot.v20250416104815
@clerk/clerk-react 5.28.1-snapshot.v20250416104815
@clerk/react-router 1.2.6-snapshot.v20250416104815
@clerk/remix 4.5.18-snapshot.v20250416104815
@clerk/shared 3.7.1-snapshot.v20250416104815
@clerk/tanstack-react-start 0.13.6-snapshot.v20250416104815
@clerk/testing 1.4.40-snapshot.v20250416104815
@clerk/themes 2.2.33-snapshot.v20250416104815
@clerk/types 4.54.1-snapshot.v20250416104815
@clerk/vue 1.6.2-snapshot.v20250416104815

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

npm i @clerk/agent-toolkit@0.0.23-snapshot.v20250416104815 --save-exact

@clerk/astro

npm i @clerk/astro@2.6.5-snapshot.v20250416104815 --save-exact

@clerk/backend

npm i @clerk/backend@1.29.0-snapshot.v20250416104815 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.2.30-snapshot.v20250416104815 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.61.1-snapshot.v20250416104815 --save-exact

@clerk/elements

npm i @clerk/elements@0.23.15-snapshot.v20250416104815 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.9.13-snapshot.v20250416104815 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@0.2.7-snapshot.v20250416104815 --save-exact

@clerk/express

npm i @clerk/express@1.4.6-snapshot.v20250416104815 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.2.6-snapshot.v20250416104815 --save-exact

@clerk/localizations

npm i @clerk/localizations@3.13.11-snapshot.v20250416104815 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.15.1-snapshot.v20250416104815 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.5.6-snapshot.v20250416104815 --save-exact

@clerk/clerk-react

npm i @clerk/clerk-react@5.28.1-snapshot.v20250416104815 --save-exact

@clerk/react-router

npm i @clerk/react-router@1.2.6-snapshot.v20250416104815 --save-exact

@clerk/remix

npm i @clerk/remix@4.5.18-snapshot.v20250416104815 --save-exact

@clerk/shared

npm i @clerk/shared@3.7.1-snapshot.v20250416104815 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@0.13.6-snapshot.v20250416104815 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.40-snapshot.v20250416104815 --save-exact

@clerk/themes

npm i @clerk/themes@2.2.33-snapshot.v20250416104815 --save-exact

@clerk/types

npm i @clerk/types@4.54.1-snapshot.v20250416104815 --save-exact

@clerk/vue

npm i @clerk/vue@1.6.2-snapshot.v20250416104815 --save-exact

Comment on lines +14 to +16
interface Window {
__clerk_script_promise?: Promise<unknown> | null | undefined;
}
Copy link
Member

Choose a reason for hiding this comment

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

Should we add this to @clerk/types instead?

@panteliselef
Copy link
Contributor Author

We decided to not proceed with this approach

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