shields icon indicating copy to clipboard operation
shields copied to clipboard

Server not starting up locally

Open PyvesB opened this issue 2 months ago • 4 comments

When running npm start locally, I'm getting the following error:

[frontend] [SUCCESS] Docusaurus website is running at: http://localhost:3000/
[frontend] 
[frontend] [ERROR] ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
[frontend]  - options.proxy should be an array:
[frontend]    [object { ... } | function, ...]
[frontend]    -> Allows to proxy requests, can be useful when you have a separate API backend development server and you want to send API requests on the same domain.
[frontend]    -> Read more at https://webpack.js.org/configuration/dev-server/#devserverproxy
[frontend]     at validate (/Users/pierreyves.bigourdan/go/src/github.com/DataDog/workspace-shields/shields/node_modules/schema-utils/dist/validate.js:166:11)
[frontend]     at new Server (/Users/pierreyves.bigourdan/go/src/github.com/DataDog/workspace-shields/shields/node_modules/webpack-dev-server/lib/Server.js:327:5)
[frontend]     at createWebpackDevServer (/Users/pierreyves.bigourdan/go/src/github.com/DataDog/workspace-shields/shields/node_modules/@docusaurus/core/lib/commands/start/webpack.js:137:12)
[frontend]     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
[frontend]     at async doStart (/Users/pierreyves.bigourdan/go/src/github.com/DataDog/workspace-shields/shields/node_modules/@docusaurus/core/lib/commands/start/start.js:31:23)
[frontend]     at async Promise.all (index 0)
[frontend]     at async runCLI (/Users/pierreyves.bigourdan/go/src/github.com/DataDog/workspace-shields/shields/node_modules/@docusaurus/core/lib/commands/cli.js:56:5)
[frontend]     at async file:///Users/pierreyves.bigourdan/go/src/github.com/DataDog/workspace-shields/shields/node_modules/@docusaurus/core/bin/docusaurus.mjs:44:3 {
[frontend]   errors: [
[frontend]     {
[frontend]       instancePath: '/proxy',
[frontend]       schemaPath: '#/definitions/Proxy/type',
[frontend]       keyword: 'type',
[frontend]       params: { type: 'array' },
[frontend]       message: 'must be array',
[frontend]       schema: 'array',
[frontend]       parentSchema: {
[frontend]         type: 'array',
[frontend]         items: { anyOf: [ { type: 'object' }, { instanceof: 'Function' } ] },
[frontend]         description: 'Allows to proxy requests, can be useful when you have a separate API backend development server and you want to send API requests on the same domain.',
[frontend]         link: 'https://webpack.js.org/configuration/dev-server/#devserverproxy'
[frontend]       },
[frontend]       data: { id: 'default' }
[frontend]     }
[frontend]   ],

@jNullj is this working for you? I hadn't started the server up locally in some time, so I don't know when this may have broken.

PyvesB avatar Oct 11 '25 11:10 PyvesB

Can reproduce.

I mostly use npm run debug:server so didn't notice. That does not show that error.

I had issues with the laptop running out of memory as well during npm build, but that just my setup.

jNullj avatar Oct 11 '25 11:10 jNullj

My vague intuition is that this could be related to the docusaurus-preset-openapi dependency not being compatible with recent versions of webpack-dev-server. There's proxy-related things in there, for example here: https://github.com/cloud-annotations/docusaurus-openapi/blob/10c6bc1ad1341277b47279cf2b58cab7dab07249/packages/docusaurus-plugin-proxy/src/types.ts#L11

PyvesB avatar Oct 11 '25 12:10 PyvesB

@jNullj is https://github.com/cloud-annotations/docusaurus-openapi/pull/301 still on your radar? That's essentially what is preventing the https://github.com/cloud-annotations/docusaurus-openapi/pull/300 fix from being released. I'm hoping npm start will work again after that! :)

PyvesB avatar Nov 22 '25 12:11 PyvesB

Yes, I stopped as I found out that another dependency is blocking this. I need to fix the PR anyway so I will look into the other issue first. I might get this done tomorrow.

jNullj avatar Nov 23 '25 16:11 jNullj