You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Babel transpiles docbox source to CommonJS, but Node.js treats .js files as ESM due to the package.json setting
The api.md generation works fine (fixed in #7274), but the HTML site build in build/docs/ fails.
Docbox hasn't been updated since June 2018 and is essentially abandoned. We should probably replace it with a modern alternative like Docsify or Docusaurus.
Steps to reproduce
osrm-backend version: current master
Run npm ci
Run npm run docs
Observe error after the babel transpilation step
Specifications
docbox version: 1.0.11
Node.js: v20+
Operating system: any (reproducible on Ubuntu 22.04 in CI and macOS locally)
Issue
The npm run docs command fails when building the HTML documentation site with docbox:
ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and 'package.json' contains "type":
"module".
This happens because:
The api.md generation works fine (fixed in #7274), but the HTML site build in build/docs/ fails.
Docbox hasn't been updated since June 2018 and is essentially abandoned. We should probably replace it with a modern alternative like Docsify or Docusaurus.
Steps to reproduce
Specifications