title: How could I fix Error during compodoc run in angular?
body: <p>enter code here&gt; Blockquote</p>
  <p>I have next error during compodoc run in angular (<code>npx compodoc -p tsconfig.app.json src</code>)</p>
  <p>How can I fix it?</p>
  <pre><code>Ooops error during main graph generation, moving on next part with main graph disabled : : Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /usr/local/lib/node_modules/@compodoc/compodoc/node_modules/@aduh95/viz.js/sync/index.js
      require() of ES modules is not supported.
      require() of /usr/local/lib/node_modules/@compodoc/compodoc/node_modules/@aduh95/viz.js/sync/index.js from /usr/local/lib/node_modules/@compodoc/compodoc/node_modules/@compodoc/ngd-transformer/dist/engines/dot/dot.js is an ES module file as it is a .js file whose nearest parent package.json contains &quot;type&quot;: &quot;module&quot; which defines all .js files in that package scope as ES modules.
      Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove &quot;type&quot;: &quot;module&quot; from /usr/local/lib/node_modules/@compodoc/compodoc/node_modules/@aduh95/viz.js/package.json.
  </code></pre>