From 5e87cd5e6ce28c51b5210f9cba82316b2dc0ca91 Mon Sep 17 00:00:00 2001 From: Convly Date: Fri, 24 May 2024 10:34:32 +0200 Subject: [PATCH 1/2] Add troubleshooting to resolve 'Cannot find module @strapi/XXX' build error A new section is added to the FAQ providing detailed guidance on how to fix the build error `Error: Cannot find module @strapi/XXX`. It provides solutions based on different package managers, specifically npm/pnpm and yarn, along with links to the official documentation. --- docusaurus/docs/dev-docs/faq.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docusaurus/docs/dev-docs/faq.md b/docusaurus/docs/dev-docs/faq.md index 2ab8206403..5a45433ed6 100644 --- a/docusaurus/docs/dev-docs/faq.md +++ b/docusaurus/docs/dev-docs/faq.md @@ -105,6 +105,19 @@ Due to these two issues, it is recommended you use a proxy application such as [ TypeScript is supported in Strapi projects from v4.2.0-beta.1 TypeScript code examples are available throughout the core Developer Documentation and a [dedicated TypeScript support page](/dev-docs/typescript.md). +## How to fix the build error `Error: Cannot find module @strapi/XXX` + +:::caution +Before trying the fix below, ensure you've executed your package manager's install command in your project. +::: + +Strapi in its current version necessitates dependency hoisting. + +By default, most package managers enable hoisting, however, if it's not functioning as expected, you can try enforcing it via your package manager's configuration. + +- If you are using npm or pnpm: Add `hoist=true` to your project's `.npmrc` file. Learn more about this from the [official pnpm documentation](https://pnpm.io/npmrc#hoist) +- If you are using Yarn: Set `nmHoistingLimits` in your `.yarnrc` file. More details can be found in the [Yarn official documentation](https://yarnpkg.com/configuration/yarnrc#nmHoistingLimits) + ## Is X feature available yet? You can see the [public roadmap](https://feedback.strapi.io/) to see which feature requests are currently being worked on and which have not been started yet, and to add new feature requests. From 8f3f0277a29ea8f9f8aca31a734653aa1140035f Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Fri, 24 May 2024 23:14:45 +0200 Subject: [PATCH 2/2] Update docusaurus/docs/dev-docs/faq.md Co-authored-by: Ben Irvin --- docusaurus/docs/dev-docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/dev-docs/faq.md b/docusaurus/docs/dev-docs/faq.md index 5a45433ed6..e257555646 100644 --- a/docusaurus/docs/dev-docs/faq.md +++ b/docusaurus/docs/dev-docs/faq.md @@ -111,7 +111,7 @@ TypeScript is supported in Strapi projects from v4.2.0-beta.1 TypeScript code ex Before trying the fix below, ensure you've executed your package manager's install command in your project. ::: -Strapi in its current version necessitates dependency hoisting. +Strapi in its current version requires dependency hoisting. By default, most package managers enable hoisting, however, if it's not functioning as expected, you can try enforcing it via your package manager's configuration.