Skip to content

Build failing in Azure pipeline when using "@easyops-cn/docusaurus-search-local": "0.48.4" #503

@GBSKUM1

Description

@GBSKUM1

Hello, With the same code build works in my local machine. But when i tried to run it in the azure pipeline using docker file the build fails with the below errors.

Can you please help here. What could be the reason for failing only in pipeline.

node version = v20.5.1
npm version = v9.8.0
docusaurus= v3.6.3

Code:

import searchLocalPlugin from "@easyops-cn/docusaurus-search-local";

plugins: [
[
'@docusaurus/plugin-content-docs',
{
id: 'docs-onboarding',
path: 'onboarding',
routeBasePath: 'onboarding',
sidebarPath: require.resolve('./sidebars.tsx'),
showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
],
[
searchLocalPlugin,
/** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
({
hashed: false,
language: ["en"],
indexDocs: true,
indexBlog: false,
docsRouteBasePath: ["docs","onboarding"],
docsDir: ["docs","onboarding"],
docsPluginIdForPreferredVersion: "docs-onboarding",
searchContextByPaths: [
{
label: "Documents",
path: "onboarding",
}
],
}),
],

Error in Azure Pipeline:

[ERROR] Error: Unable to build website for locale en.
at tryToBuildLocale (/var/lib/azure-devops/-Self-Hosted/-Self-Hosted-001-01/_work/1739/s/node_modules/@docusaurus/core/lib/commands/build/build.js:78:15)
at async /var/lib/azure-devops/-Self-Hosted/-Self-Hosted-001-01/_work/1739/s/node_modules/@docusaurus/core/lib/commands/build/build.js:34:9
... 4 lines matching cause stack trace ...
at async file:///var/lib/azure-devops/-Self-Hosted/-Self-Hosted-001-01/_work/1739/s/node_modules/@docusaurus/core/bin/docusaurus.mjs:44:3 {
[cause]: Error: Docusaurus static site generation failed for 124 paths

at generateStaticFiles (/var/lib/azure-devops/-Self-Hosted/-Self-Hosted-001-01/_work/1739/s/node_modules/@docusaurus/core/lib/ssg/ssg.js:129:15)
at async executeSSG (/var/lib/azure-devops/-Self-Hosted/-Self-Hosted-001-01/_work/1739/s/node_modules/@docusaurus/core/lib/ssg/ssgExecutor.js:29:23)
... 9 lines matching cause stack trace ...
at async file:///var/lib/azure-devops/-Self-Hosted/-Self-Hosted-001-01/_work/1739/s/node_modules/@docusaurus/core/bin/docusaurus.mjs:44:3 {
[cause]: AggregateError

Error: Can't render static file for pathname "/404.html"
at generateStaticFile (/var/lib/azure-devops/-Self-Hosted/-Self-Hosted-001-01/_work/1739/s/node_modules/@docusaurus/core/lib/ssg/ssg.js:167:15)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at runNextTicks (node:internal/process/task_queues:64:3)
at process.processImmediate (node:internal/timers:449:9)
at async /var/lib/azure-devops/-Self-Hosted/-Self-Hosted-001-01/_work/1739/s/node_modules/p-map/index.js:57:22 {
[cause]: reactUtils_ReactContextError
at navbarMobileSidebar_useNavbarMobileSidebar (server.bundle.js:21581:557)
at NavbarLayout (server.bundle.js:22079:311)
at Uc (server.bundle.js:9196:44)
at Xc (server.bundle.js:9198:253)
at Z (server.bundle.js:9204:89)
at Xc (server.bundle.js:9198:481)
at Z (server.bundle.js:9204:89)
at Yc (server.bundle.js:9207:98)
at $c (server.bundle.js:9206:140)
at Z (server.bundle.js:9204:345) {
message: 'Hook navbarMobileSidebar_useNavbarMobileSidebar is called outside the . '

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions