-
Notifications
You must be signed in to change notification settings - Fork 39
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
When using webpack 5, cannot import this package. #12
Comments
As a workaround, patching this package upon installation with patch-package. The patch I use is the following:
|
Also having this problem |
backspace
added a commit
to backspace/adventure-gathering
that referenced
this issue
Feb 3, 2023
Thanks to @leokolezhuk for sharing this patch: chen0040/js-graph-algorithms#12 (comment)
backspace
added a commit
to backspace/adventure-gathering
that referenced
this issue
Feb 18, 2023
Thanks to @leokolezhuk for sharing this patch: chen0040/js-graph-algorithms#12 (comment)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Upgraded to webpack 5.7 from 4.x and VueCli 5 from 4.
In an es module using the js-graph-algorithms package.
const jsgraphs = require('js-graph-algorithms');
In this case jsgraphs is an empty object and errors are raised like
Cannot read property Graph of undefined when trying to access jsgraphs.Graph.
This is caused by the way jsgraphs object is exported in src/jsgraphs.js
The code
var module = module || {}; if(module) { module.exports = jsgraphs; }
seems to confuse webpack.
If I change this code to a normal commonjs export:
module.exports = jsgraphs;
without any extra logic, everything works normally.
The text was updated successfully, but these errors were encountered: