The npm run docs command fails in CI with:
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 '/home/runner/work/osrm-backend/osrm-backend/package.json' contains "type": "module".
Root cause: #7233 added "type": "module" to package.json. The docs build uses Babel to transpile docbox's files to CommonJS, but Node.js still treats the .js output as ESM.
The
npm run docscommand fails in CI with:This file is being treated as an ES module because it has a '.js' file extension and '/home/runner/work/osrm-backend/osrm-backend/package.json' contains "type": "module".
Root cause: #7233 added
"type": "module"to package.json. The docs build uses Babel to transpile docbox's files to CommonJS, but Node.js still treats the.jsoutput as ESM.