Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionclosed: duplicateThis issue or pull request already exists in another issue or pull request
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
Docusaurus builds are failing in CI with:
website:build | /home/runner/work/moon/moon/node_modules/@docusaurus/utils/lib/index.js:9
website:build | exports.replaceMarkdownLinks = exports.writeMarkdownHeadingId = exports.parseMarkdownString = exports.parseMarkdownContentTitle = exports.parseFrontMatter = exports.createExcerpt = exports.parseMarkdownHeadingId = exports.groupTaggedItems = exports.normalizeFrontMatterTags = exports.buildSshUrl = exports.buildHttpsUrl = exports.hasSSHProtocol = exports.removeTrailingSlash = exports.addTrailingSlash = exports.addLeadingSlash = exports.resolvePathname = exports.isValidPathname = exports.encodePath = exports.fileToPath = exports.getEditUrl = exports.normalizeUrl = exports.findAsyncSequential = exports.mapAsyncSequential = exports.removePrefix = exports.removeSuffix = exports.localizePath = exports.getPluginI18nPath = exports.updateTranslationFileMessages = exports.mergeTranslations = exports.GitNotFoundError = exports.FileNotTrackedError = exports.getFileCommitDate = exports.readOutputHTMLFile = exports.generate = exports.WEBPACK_URL_LOADER_LIMIT = exports.DEFAULT_PLUGIN_ID = exports.DEFAULT_PORT = exports.CODE_TRANSLATIONS_FILE_NAME = exports.DEFAULT_I18N_DIR_NAME = exports.THEME_PATH = exports.OUTPUT_STATIC_ASSETS_DIR_NAME = exports.DEFAULT_STATIC_DIR_NAME = exports.SRC_DIR_NAME = exports.GENERATED_FILES_DIR_NAME = exports.BABEL_CONFIG_FILE_NAME = exports.DEFAULT_CONFIG_FILE_NAME = exports.DEFAULT_BUILD_DIR_NAME = exports.DOCUSAURUS_VERSION = exports.NODE_MINOR_VERSION = exports.NODE_MAJOR_VERSION = void 0;
website:build |
website:build |
website:build | TypeError: Cannot set property NODE_MAJOR_VERSION of #<Object> which has only a getter
website:build | at Object.<anonymous> (/home/runner/work/moon/moon/node_modules/@docusaurus/utils/lib/index.js:9:1421)
website:build | at Module._compile (node:internal/modules/cjs/loader:1241:14)
website:build | at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
website:build | at Module.load (node:internal/modules/cjs/loader:1091:32)
website:build | at Module._load (node:internal/modules/cjs/loader:938:12)
website:build | at Module.require (node:internal/modules/cjs/loader:1115:19)
website:build | at require (node:internal/modules/helpers:130:18)
website:build | at Object.<anonymous> (/home/runner/work/moon/moon/node_modules/@docusaurus/utils/lib/dataFileUtils.js:15:17)
website:build | at Module._compile (node:internal/modules/cjs/loader:1241:14)
website:build | at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
Reproducible demo
No response
Steps to reproduce
I'm like 99% sure this is caused by Node.js v20.6.0, which came out today, the same time these errors started cropping up: https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V20.md#20.6.0
However, this seems to only happen in CI and not locally. https://github.com/moonrepo/moon/actions/runs/6078432962/job/16489581930?pr=1037
Expected behavior
It builds correctly.
Actual behavior
It fails with a non-fixable error.
Your environment
- Public source code:
- Public site URL:
- Docusaurus version used:
- Environment name and version (e.g. Chrome 89, Node.js 16.4):
- Operating system and version (e.g. Ubuntu 20.04.2 LTS):
Self-service
- I'd be willing to fix this bug myself.
Reacted by Jan Voráček, Shamil, silverwind, Joseph Wilson, Zacky Ma, Sergio Torres Teixeira Filho, Ev Haus, Andras Lassu and Florian Castellane
Reacted by mikaello
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionclosed: duplicateThis issue or pull request already exists in another issue or pull request
Activity
Josh-Cena commentedon Sep 5, 2023
I can't reproduce this locally either...
Does it work if you downgrade your Node version in your CI?
milesj commentedon Sep 5, 2023
@Josh-Cena Yup it works in 20.5: https://github.com/moonrepo/moon/actions/runs/6079098874/job/16491161043?pr=1037
Shalevos commentedon Sep 5, 2023
I'm also experiencing this when building with node v20.6.0 .
This happens when running locally as well as on Render.
milesj commentedon Sep 5, 2023
We may need to report this to node, but I'm not entirely sure how to phrase it...
Josh-Cena commentedon Sep 5, 2023
It would help if someone can reproduce this locally. From there, we can try to minimize the reproduction because it obviously involves transpiled CJS code.
quality-leftovers commentedon Sep 6, 2023
Also affected in ci-pipeline using node:latest image for build. It's a private repo so cannot help with reproducing.
Fix node version to 20.5 due to a bug
Merge upcoming into main for Hyper API September Release (#52)
cmdcolin commentedon Sep 6, 2023
this can be reproduced locally if you install the specific version of node 20.6.0. can use "fnm" or "nvm" or similar to get versions currently 20.6.0 also runs into #9286 so to reproduce, you can use an old version of node to create the docusaurus instance, then the newer version hits the error
shell log
Fix docusaurus build by using older node, xref meta/docusaurus#9278
Fix docusaurus website using older node pt2, xref meta/docusaurus#9278
slorber commentedon Sep 7, 2023
Probably related to nodejs/node#49497
fix: build
josephw-ml commentedon Sep 7, 2023
In case this helps reproducibility:
I reproduce this error (reliably) using a docker/containerfile.
One can get the template docusaurus example, add this containerfile, and then build the container to reproduce.
ayhoung commentedon Sep 8, 2023
also getting this error with v20.6.:
slorber commentedon Sep 8, 2023
Duplicate of #9291
Fix docusaurus build by using older node, xref meta/docusaurus#9278
Fix docusaurus website using older node pt2, xref meta/docusaurus#9278