Repository navigation
Closed
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
Description
Version
v18.0.0-pre
Platform
No response
Subsystem
build
What steps will reproduce the bug?
Run CI. https://ci.nodejs.org/job/node-test-commit-linux-containered/nodes=ubuntu1804_sharedlibs_withoutintl_x64/ builds have been consistently failing starting today. These are run with python3 ./configure --verbose --without-intl.
e.g. From today's daily build:
https://ci.nodejs.org/job/node-test-commit-linux-containered/29799/nodes=ubuntu1804_sharedlibs_withoutintl_x64/console
How often does it reproduce? Is there a required condition?
Seems consistent for builds today.
What is the expected behavior?
Build completes.
What do you see instead?
08:05:45 /home/iojs/build/workspace/node-test-commit-linux-containered/tools/doc/node_modules/highlight.js/lib/languages/python.js:10
08:05:45 const IDENT_RE = /[\p{XID_Start}_]\p{XID_Continue}*/u;
08:05:45 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
08:05:45
08:05:45 SyntaxError: Invalid regular expression: /[\p{XID_Start}_]\p{XID_Continue}*/: Invalid property name in character class
08:05:45 at Object.compileFunction (node:vm:352:18)
08:05:45 at wrapSafe (node:internal/modules/cjs/loader:1026:15)
08:05:45 at Module._compile (node:internal/modules/cjs/loader:1061:27)
08:05:45 at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
08:05:45 at Module.load (node:internal/modules/cjs/loader:975:32)
08:05:45 at Function.Module._load (node:internal/modules/cjs/loader:822:12)
08:05:45 at Module.require (node:internal/modules/cjs/loader:999:19)
08:05:45 at require (node:internal/modules/cjs/helpers:102:18)
08:05:45 at Object.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux-containered/tools/doc/node_modules/highlight.js/lib/index.js:144:33)
08:05:45 at Module._compile (node:internal/modules/cjs/loader:1097:14)
08:05:45
Additional information
No response
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
Activity
richardlau commentedon Dec 3, 2021
The error was thrown from
highlight.js, which was updated in #41036 (and deemed to not require a full CI 😞).richardlau commentedon Dec 3, 2021
https://ci.nodejs.org/job/node-test-commit-linux-containered/29823/nodes=ubuntu1804_sharedlibs_withoutintl_x64/ (❌)
https://ci.nodejs.org/job/node-test-commit-linux-containered/29822/nodes=ubuntu1804_sharedlibs_withoutintl_x64/ (✔️)
targos commentedon Dec 4, 2021
I suppose that this regular expression requires ICU data to work.
tools: rollback highlight.js
Trott commentedon Dec 4, 2021
Does the regexp literal stop throwing an error in no-icu builds if we change
XIDtoID?EDIT: Based on the table in https://nodejs.org/dist/latest-v17.x/docs/api/intl.html#options-for-building-nodejs, I'd expect that it still wouldn't work, but I'm building a non-icu node right now to confirm.
EDIT: I also don't see any elegant way to do feature detection for regexp property class names other than
try/catch. Correction welcome.@nodejs/i18n-api
Trott commentedon Dec 4, 2021
On the other hand, the spec seems to say that
ID_STARTis required butXID_STARTis not, so maybe V8 handles it even without Node.js compiling ICU?richardlau commentedon Dec 4, 2021
Fwiw the highlight.js change that introduced the regexp is highlightjs/highlight.js#3280. Do we highlight Python anywhere in our docs? Maybe we could minimally load highlight.js and only register the languages we expect to highlight in our docs?
Trott commentedon Dec 4, 2021
If all else fails, another possibility might be to skip building (or at least syntax highlighting) docs on
without-intlbuilds.Trott commentedon Dec 4, 2021
Confirmed that it throws an error still with that change.
Trott commentedon Dec 4, 2021
Based on
grep -rl '```py' doc/, it seems that we do not.That seems like a feature
highlight.jssupports, based on https://www.npmjs.com/package/highlight.js.Trott commentedon Dec 4, 2021
LOL! This is the way we're actually doing it already, but we're still importing everything at the outset. The fix here is a single line change to html.mjs. PR coming in a few minutes.
Trott commentedon Dec 4, 2021
Also, I'm kind of wondering if we want to require at least a minimal intl. I'm not sure what the use case is for
--without-intlthough so maybe that's short-sighted. (Maybe it's for a small build size for constrained environments like IoT?)aduh95 commentedon Dec 4, 2021
Related: #35942
13 remaining items
tools: rollback highlight.js
build: skip documentation generation if no ICU
tools: update highlight.js to 11.3.1
tools: rollback highlight.js
build: skip documentation generation if no ICU
tools: update highlight.js to 11.3.1
tools: rollback highlight.js
build: skip documentation generation if no ICU
tools: update highlight.js to 11.3.1
tools: rollback highlight.js
build: skip documentation generation if no ICU
tools: update highlight.js to 11.3.1