0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

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

* docs(console): add the troubleshoot section in expo guide

add the troubleshoot section in expo integration guide

* chore: update the words

update the words
This commit is contained in:
simeng-li 2024-06-20 11:11:39 +08:00 committed by GitHub
parent 0f3dbbc4a9
commit e6f06cbbb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -113,7 +113,9 @@ const Content = () => {
{isAuthenticated ? ( {isAuthenticated ? (
<Button title="Sign out" onPress={async () => signOut()} /> <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> </div>
); );
@ -153,7 +155,9 @@ const Content = () => {
<Button title="Sign out" onPress={async () => signOut()} /> <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> </div>
); );
@ -169,4 +173,28 @@ const Content = () => {
</Step> </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> </Steps>