Closed markjaquith closed 1 year ago
Hello @markjaquith and thank you for reporting this one.
We are currently making some changes to our bundling of @clerk/shared
package.
We will check this and let you know.
I'm thinking that @clerk/clerk-sdk-node
shouldn't have a dependency on @clerk/shared
as it stands.
@clerk/shared
depends on react
, so now even non-React projects that are using the node SDK to do server-side auth have to depend on React.
See this report in Discord: https://discord.com/channels/856971667393609759/1163476965563572234
@clerk/shared
has a peerDependency
on react
as it stands, so it doesn't automatically pulls it in. But you can run into issues with it, yes.
In https://github.com/clerkinc/javascript/pull/1868 I made that optional through https://docs.npmjs.com/cli/v7/configuring-npm/package-json#peerdependenciesmeta
But it still has to be released through https://github.com/clerkinc/javascript/pull/1867. There's also more work in progress to isolate the parts through npm subpaths so that in e.g. Node environment the React parts never get pulled in.
I'll let you know once we have a version to test.
Hey 👋
Can you please try this version:
npm install @clerk/clerk-sdk-node@4.12.15-snapshot.v552195d --save-exact
I tried it with your reproduction and the build works. Please see if in addition to the build succeeding also the functionality works 😆
P.S.: Your reproduction was missing an .env
file so at first my build failed on missing env vars
I tried @clerk/clerk-sdk-node@4.12.15-snapshot.v552195d
on the full app that this example was boiled down from. No build issues, and Clerk logins are working!
@markjaquith Awesome! I pushed a change, could you also try this version?
npm i @clerk/clerk-sdk-node@4.12.15-snapshot.vf9232b3 --save-exact
Thanks!
That version is also building and working for me. 👍🏻
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Preliminary Checks
[X] I have reviewed the documentation: https://clerk.com/docs
[X] I have searched for existing issues: https://github.com/clerkinc/javascript/issues
[X] I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
[X] This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction / Replay Link
https://github.com/markjaquith/clerk-sdk-node-4-12-13-bug
Publishable key
pk_test_Y2xvc2luZy1seW54LTkzLmNsZXJrLmFjY291bnRzLmRldiQ
Description
@clerk/clerk-sdk-node
v4.12.13 introduced an import from@clerk/shared
to handle deprecation notices.This import breaks Vite builds, because of some CommonJS import nonsense.
With v4.12.12, Vite builds clean.
With v4.12.13 when running
npm run build
, I get:The fact that I'm using SvelteKit here isn't material. None of the functionality matters, just that Vite is now (in a patch update) choking on
@clerk/shared
apparently being a CommonJS module.Reproduction
npm i
npm run build
(see error)npm i @clerk/clerk-sdk-node@4.12.12
(revert to earlier version)npm run build
(no error)Environment
SDK-815