javascript icon indicating copy to clipboard operation
javascript copied to clipboard

Rollup cannot not resolve './Crypto' from @clerk/clerk-sdk-node/esm/utils/index.js

Open ermartinez13 opened this issue 4 years ago • 4 comments

Package + Version

  • [ ] @clerk/clerk-js
  • [ ] @clerk/clerk-react
  • [ ] @clerk/nextjs
  • [ ] @clerk/remix
  • [ ] @clerk/types
  • [ ] @clerk/themes
  • [ ] @clerk/clerk-expo
  • [ ] @clerk/backend-core
  • [x] @clerk/clerk-sdk-node
  • [ ] @clerk/edge
  • [ ] other:

Version:

'@cleark/clerk-sdk-node': 4.1.3

Description

Rollup consistently returned the following message from a GitHub Actions job:

Error: Could not resolve './Crypto' from node_modules/@clerk/clerk-sdk-node/esm/utils/index.js

Due to the following import statement:

// node_modules/@clerk/clerk-sdk-node/esm/index.js
export * from './Crypto';

The file structure for the issue is as follows:

# within node_modules/@clerk:
clerk-sdk-node/
|-- esm/
|    |-- utils/
|         |-- crypto.js
|         |-- index.js

After some digging, I found this commit in a merged Rollup PR stating that imports are case sensitive.

Thus, it seems that because the import statement reads ./Crypto instead of ./crypto, the Rollup error is triggered.

I was able to work around this by using patch-package to fix the casing in the import statement.

To be honest, I'm not sure if this error is a non-issue from Clerk's side (perhaps there's a Rollup setting I overlooked) but hopefully this can help anyone else dealing with the same issue.

If this is a valid oversight from Clerk's side, let me know and I'll submit a PR request :)

ermartinez13 avatar Sep 02 '22 15:09 ermartinez13

Hi @ermartinez13. Thanks for raising this. I am currently away from my laptop so can you please submit the PR? I can deploy a new version later today.

SokratisVidros avatar Sep 03 '22 10:09 SokratisVidros

This is now fixed in 4.1.4

SokratisVidros avatar Sep 05 '22 14:09 SokratisVidros

This is now fixed in 4.1.4

Thanks!

P.S> I apologize for not submitting the PR, seems like I have my GH notifications off so I never saw the reply.

ermartinez13 avatar Sep 05 '22 15:09 ermartinez13

No worries.

SokratisVidros avatar Sep 05 '22 16:09 SokratisVidros