clerk / javascript

Official JavaScript repository for Clerk authentication
https://clerk.com
MIT License
1.14k stars 258 forks source link

Unable to resolve module @clerk/shared/authorization #4177

Closed yessineZ closed 1 month ago

yessineZ commented 1 month ago

Preliminary Checks

Reproduction

https://github.com/yessineZ/MistyUberr

Publishable key

pk_test_Y2xldmVyLWdyb3VwZXItNjIuY2xlcmsuYWNjb3VudHMuZGV2JA

Description

Hello , i am working on reactNative project and i faced a problem when i try to add clerk to do the authentication feature , when i wrap the application with clerkProvider and clerkLoaded in _layout file under the app folder , i try to start the project i see this error : Unable to resolve module @clerk/shared/authorization from C:\Users\yessi\Desktop\MOBILE LEARNING\MistyUber\node_modules\@clerk\clerk-react\dist\internal.js: @clerk/shared/authorization could not be found within the project or in these directories: node_modules 62 | 63 | // src/hooks/useAuth.ts

64 | var import_authorization = require("@clerk/shared/authorization"); | ^ 65 | var import_react5 = require("react"); 66 | 67 | // src/errors/messages.ts and when i remove ClerkProvider and ClerkLoaded the error disappear and the application work fine , i followed the documentation of clerk with reactNative and i installed all the packages needed , thank you and i am waiting for your help .

Environment

EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_Y2xldmVyLWdyb3VwZXItNjIuY2xlcmsuYWNjb3VudHMuZGV2JA
mewc commented 1 month ago

+1 this is happening atm.

iOS Bundling failed 954ms node_modules/expo-router/entry.js (2152 modules)
Unable to resolve "@clerk/shared/authorization" from "node_modules/@clerk/clerk-react/dist/internal.js"
› Reloading apps
iOS Bundling failed 740ms node_modules/expo-router/entry.js (2111 modules)
Unable to resolve "@clerk/shared/authorization" from "node_modules/@clerk/clerk-react/dist/internal.js"
Android Bundling failed 6725ms node_modules/expo-router/entry.js (1 module)
Unable to resolve "@clerk/shared/authorization" from "node_modules/@clerk/clerk-react/dist/internal.js"
Android Bundling failed 6298ms node_modules/expo-router/entry.js (1 module)
Unable to resolve "@clerk/shared/authorization" from "node_modules/@clerk/clerk-react/dist/internal.js"
Android Bundling failed 6728ms node_modules/expo-router/entry.js (2237 modules)
Unable to resolve "@clerk/shared/authorization" from "node_modules/@clerk/clerk-react/dist/internal.js"

temp solve to unblock for expo app: "@clerk/clerk-expo": "2.2.4", instead of something like "@clerk/clerk-expo": "^2.2.4",

(below is yarn lock)

"@clerk/clerk-expo@^2.2.12":
  version "2.2.12"
  resolved "https://registry.yarnpkg.com/@clerk/clerk-expo/-/clerk-expo-2.2.12.tgz#5ac92f66a7b15d49e5e5d04f775fe6caa0941184"
  integrity sha512-muFZB4np4lachbwwZRj+9nR6DLRPh5AdVNndk73sszCrhwx5j5BjN3YC06r/DJYnhfN4RorFZzq6qeVs+XCHpA==
  dependencies:
    "@clerk/clerk-js" "5.22.1"
    "@clerk/clerk-react" "5.9.0"
    "@clerk/shared" "2.8.0"
    "@clerk/types" "4.21.0"
    base-64 "^1.0.0"
    react-native-url-polyfill "2.0.0"
    tslib "2.4.1"
i've reverted back to 
    "@clerk/clerk-expo@^2.0.0":
  version "2.2.4"
  resolved "https://registry.npmjs.org/@clerk/clerk-expo/-/clerk-expo-2.2.4.tgz"
  integrity sha512-ey7uPU+xFr8lx70Lq5K22zchi/qZxgFWqn6oiK3VQ93PdIsJoTyiHePEFZDVBdquBgv30bAm2aX7pnSkGpggPg==
  dependencies:
    "@clerk/clerk-js" "5.17.0"
    "@clerk/clerk-react" "5.4.5"
    "@clerk/shared" "2.5.5"
    "@clerk/types" "4.16.0"
    base-64 "^1.0.0"
    react-native-url-polyfill "2.0.0"
    tslib "2.4.1"
hyochan commented 1 month ago

Downgrading to 2.0.0 works as I posted in #4178 It also works in 2.2.10 and not working from 2.2.11. Below changes might have some issue https://github.com/clerk/javascript/compare/%40clerk/clerk-expo%402.2.10...%40clerk/clerk-expo%402.2.11

yessineZ commented 1 month ago

thank you guys it works when i downgraded to 2.2.10

LekoArts commented 1 month ago

This should be fixed with @clerk/expo version 2.2.13