From 8321925404c6810f82b1bc07703d24670389e159 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 31 Jul 2023 12:30:13 +0300 Subject: [PATCH] docs: added troubleshooting section for medusa-react (#4639) --- docs/content/medusa-react/overview.mdx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/content/medusa-react/overview.mdx b/docs/content/medusa-react/overview.mdx index 2166fb7873..a5cdca929b 100644 --- a/docs/content/medusa-react/overview.mdx +++ b/docs/content/medusa-react/overview.mdx @@ -80,6 +80,26 @@ In the example above, you wrap the `Storefront` component with the `MedusaProvid The `Storefront` component and its child components can now use hooks exposed by Medusa React. +### Troubleshooting: Could not find a declaration file for module 'medusa-react' + +If you import `medusa-react` in your code and see the following TypeScript error: + +```bash +Could not find a declaration file for module 'medusa-react' +``` + +Make sure to set `moduleResolution` in your `tsconfig.json` to `nodenext` or `node`: + +```json title=tsconfig.json +{ + "compilerOptions": { + "moduleResolution": "nodenext", + // ... + }, + // ... +} +``` + ### MedusaProvider Optional Props You can also pass the following props to Medusa Provider: