dagre
dagre copied to clipboard
Fixed a require bug in graphlib.js
Fixed bug Uncaught TypeError: Cannot read property 'preorder' of undefined.
This would be a great fix, to avoid having to patch dagre in node_modules
.
Is there an issue providing some context and repro steps?
Essentially we've a project compiling Typescript with Webpack + Babel, and without the /index
it errors on the require
statement.
@ctcarton Do you have any additional details that might help give more context?
After some investigation I've found that the module redirection that dagre is using here is confusing webpack. The simple solution I've found is to update webpack.config.js
with a resolve alias which forces always using the version of graphlib in node_modules.
In module.exports
in webpack.config.js
:
resolve: {
alias: {
"graphlib": "node_modules/graphlib"
},
}