-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Native iOS unable to link @casl #523
Comments
Did you try to add package.json to exports manually to casl’s repos, in node_modules? Just to see whether it works |
any updates on this? |
Yeah. I just did. It builds and links. But it still gives me the same "can not defined" error. |
I believe you did something wrong. I have created a simple example for the react-native app. You can check it out here. |
Thanks @Todmy for checking it! Close this as I don't see a reason to add package.json into Otherwise, every library in npm repo that can be used with RN should add package.json into exports, what seems meaningless |
Describe the bug
TLDR: React Native iOS unable to link both @casl/ability and @casl/react due to the following warning
I recently upgraded my React and React Native to
17.0.1
and0.64.2
and @CASL stopped working on iOS. It works on Android. During linking, I get the warning above. Due to the failure of linkage - see warning above.When I try to use, say
Can
, I get aCannot read property 'can' of undefined
To Reproduce
prerequisite: React 17.0.1, react Native 0.64.2
npm install @casl/react @casl/ability
Can
to check abilityExpected behavior
I should be able to use
Can
to check ability.Interactive example (optional, but highly desirable)
provide a link to the example from http://repl.it/, https://codesandbox.io/ or similar, so we can quickly test and provide feedback. Otherwise
CASL Version
Environment:
The text was updated successfully, but these errors were encountered: