Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a require bug in graphlib.js #283

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TimMouskhelichvili
Copy link

Fixed bug Uncaught TypeError: Cannot read property 'preorder' of undefined.

Fixed bug Uncaught TypeError: Cannot read property 'preorder' of undefined.
@brianmhunt
Copy link

This would be a great fix, to avoid having to patch dagre in node_modules.

@lutzroeder
Copy link
Contributor

Is there an issue providing some context and repro steps?

@brianmhunt
Copy link

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?

@ctcarton
Copy link

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"
        },
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants