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:
parent
0f3dbbc4a9
commit
e6f06cbbb7
1 changed files with 30 additions and 2 deletions
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue