Closed DonaldKellett closed 7 hours ago
I'm sorry but this kind of bug report is unactionnable from my perspective.
I really need a repro, or I can't help. If your site contains sensitive data, then create a copy and remove all that sensitive data.
One thing is clear, the issue has nothing to do with p-map
. The error is a missing (or duplicated) React context provider.
It might be caused by various things, and most likely is related to duplicated npm packages in your repository, or swizzled theme code. That's why I need to be able to fully inspect your setup.
We'll reopen if you help us help you and provide a runnable repro.
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Building our production Technical KB written in Docusaurus with
npm run build
recently failed consistently with the error message below.The problem is reproducible in that the error appears 100% of the time when we try to add just 1 more item to our manually created sidebar (maybe our sidebar is too large?) regardless of what the item is or where it is placed within the sidebar, but our Docusaurus site contains sensitive and confidential information so we can't share the source code here. Nevertheless, we'll try to include as much relevant information as possible to help reproduce the issue without divulging too many details.
Reproducible demo
No response
Steps to reproduce
Without divulging too many details, we're using Docusaurus v3.6.1 with the
@docusaurus/faster
plugin enabled though we found that the issue persists regardless of whether the experimental plugin is enabled or disabled.Our
package.json
andpackage-lock.json
files are as attached. In particular, the version ofp-map
used as seen inpackage-lock.json
is4.0.0
which is important as we will see later:The issue is consistently triggered when we try to add 1 more item anywhere within our manually created sidebar in
sidebars.js
. Here's an overview of what it looks like:For reference, here's what our
docusaurus.config.js
looks like (portions omitted due to containing sensitive information):Expected behavior
Building the site with
npm run build
finishes without issues. The site loads and displays correctly withnpm run serve
.Actual behavior
Docusaurus static site generation failed for 306 paths:
The detailed error for each failure is "Error: Unexpected: no Docusaurus route context found" which can be traced down to
p-map/index.js:57:22
and is identical for each failure.The offending line in version
4.0.0
ofp-map
is: https://github.com/sindresorhus/p-map/blob/a4b4dec459544d98880bc53a580e53691aff9fa9/index.js#L57Screenshots containing the error messages in our failing GitLab CI builds are attached below.
Your environment
v18.17.1
Self-service