tbo47 / dagre-es

The dagrejs library exported as ES modules.
Other
32 stars 14 forks source link

Add `type: module` #11

Closed sidharthv96 closed 1 year ago

sidharthv96 commented 1 year ago

dagre-d3-es doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.

Error found in https://github.com/mermaid-js/mermaid-live-editor/pull/1119

Another error

SyntaxError: Named export 'addHtmlLabel' not found. The requested module 'dagre-d3-es/src/dagre-js/label/add-html-label.js' 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 'dagre-d3-es/src/dagre-js/label/add-html-label.js'; const { addHtmlLabel: addHtmlLabel$1 } = pkg;

sidharthv96 commented 1 year ago

Thank you @tbo47 !

tbo47 commented 1 year ago

Thanks to you @sidharthv96