I take the following steps;
npm install -g @developer-overheid-nl/don-checker@latest
npx @developer-overheid-nl/don-checker@latest validate --ruleset adr-20 --input ./openapi.json
This results in the following error:
import { extname } from "@stoplight/path";
^^^^^^^
SyntaxError: Named export 'extname' not found. The requested module '@stoplight/path' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@stoplight/path';
const { extname } = pkg;
Fix
I figured out that when I use node 24 (nvm use 24) the error is fixed (obviously because it accepts this type of importing).
Proper fix
I assume a lot of people use older versions of node (20.17.0 etc.). Can we fix this issue for them?
I take the following steps;
npm install -g @developer-overheid-nl/don-checker@latestnpx @developer-overheid-nl/don-checker@latest validate --ruleset adr-20 --input ./openapi.jsonThis results in the following error:
import { extname } from "@stoplight/path";
^^^^^^^
SyntaxError: Named export 'extname' not found. The requested module '@stoplight/path' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@stoplight/path';
const { extname } = pkg;
Fix
I figured out that when I use node 24 (
nvm use 24) the error is fixed (obviously because it accepts this type of importing).Proper fix
I assume a lot of people use older versions of node (20.17.0 etc.). Can we fix this issue for them?