Open
Description
Description
Error occurs when specifying custom theme on v14 series.
How are you running documentation.js
Node.js API
Version
documentation.js version:v14.0.3
Node.js version: v20.10.0
OS: Windows 10
The current behavior
When I specify the custom theme and run it, I get the following error in the console log.
node:internal/modules/esm/load:236
throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed, schemes);
^
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol
'c:'
at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:236:11)
at defaultLoad (node:internal/modules/esm/load:128:3)
at ModuleLoader.load (node:internal/modules/esm/loader:409:13)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:56)
at new ModuleJob (node:internal/modules/esm/module_job:65:26)
at #createModuleJob (node:internal/modules/esm/loader:303:17)
at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:260:34)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:241:17)
at async ModuleLoader.import (node:internal/modules/esm/loader:328:23) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
The expected behavior
Specify the custom theme and run it to output documentation with the custom theme applied.
input code,output documentation
For all codes that do not depend on the input code, output documentation is not printed and an error is generated in the console. (More information on console errors can be found in "The current behavior".)
Steps To Reproduce
-
- Create new project folder & npm initialize
mkdir doc && cd doc && npm init -y
-
- Install documentation.js
npm i -D documentation@latest
-
- Create custom theme (copy defalut theme to create custom theme)
cp -r node_modules/documentation/src/default_theme custom_theme
-
- Create build script (build.mjs)
// build.mjs import * as documentation from 'documentation'; const runDocumentation = async () => { const comments = await documentation.build(['index.js']); const output = await documentation.formats.html(comments, {theme: 'custom_theme'}); }; runDocumentation();
-
- Create input file (copy build.js to create index.js)
cp build.mjs index.js
-
- Build the documentation
node build.mjs
Metadata
Metadata
Assignees
Labels
No labels