Skip to content
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

docs(console): add the troubleshooting section in expo guide #6052

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions packages/console/src/assets/docs/guides/native-expo/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ const Content = () => {
{isAuthenticated ? (
<Button title="Sign out" onPress={async () => signOut()} />
) : (
<Button title="Sign in" onPress={async () => signIn('${props.redirectUris[0] ?? 'io.logto://callback'}')} />
<Button title="Sign in" onPress={async () => signIn('${
props.redirectUris[0] ?? 'io.logto://callback'
}')} />
)}
</div>
);
Expand Down Expand Up @@ -153,7 +155,9 @@ const Content = () => {
<Button title="Sign out" onPress={async () => signOut()} />
</>
) : (
<Button title="Sign in" onPress={async () => signIn('${props.redirectUris[0] ?? 'io.logto://callback'}')} />
<Button title="Sign in" onPress={async () => signIn('${
props.redirectUris[0] ?? 'io.logto://callback'
}')} />
)}
</div>
);
Expand All @@ -169,4 +173,28 @@ const Content = () => {

</Step>

<Step title="Troubleshooting">

For Expo projects, if you encounter the error `Unable to resolve "@logto/client/shim" from "node_modules/@logto/rn/lib/index.js"`, you can resolve it by adding the following to your `metro.config.js` file:

```js
// metro.config.js
const config = {
// ...
resolver: {
unstable_enablePackageExports: true,
},
};

module.exports = config;
```

This error indicates that `@logto/rn` package is not able to resolve the `@logto/client/shim` module.

As the node exports were used in the`@logto/client` package, and package exports are not enabled by default in Metro bundler, you need to enable them manually.

See the [React Native package exports support](https://reactnative.dev/blog/2023/06/21/package-exports-support#enabling-package-exports-beta) for more details.

</Step>

</Steps>
Loading