-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Dist folder files is not covered in package.json exports
field
#3239
Comments
can confirm this bug, got this error with 3.29.0 - |
Looks like there is an issue in this dependency: cytoscape/cytoscape.js#3239 so I am trying to force the previous version
* Fix build website CI Looks like there is an issue in this dependency: cytoscape/cytoscape.js#3239 so I am trying to force the previous version * Update package.json
We're running into a similar issue trying to build/deploy Docusaurus (including the mermaid diagrams plugin which is what's bringing in cytoscape) on AWS Amplify:
|
I ran into similar error introduced by v3.29.0
Here is repo with minimum code to reproduce the error: https://github.com/allala0/cytoscape-error/ |
3.29.1 has been released, please let me know if it resolves your issues |
@mikekucera - thanks for looking into this. With
Update 1: It looks like Mermaid's patching Cytoscape. Perhaps that's something that could be done on the Cytoscape side so that Mermaid can avoid patching? Or perhaps Mermaid should use Cytoscape differently? 🤔 |
Hi @jan-molak |
@mikekucera - thanks for getting back to me. No worries, JavaScript build systems are anything but intuitive :-) I proposed a fix in #3241 I believe the issue is caused by Mermaid requiring Cytoscape using:
But Cytoscape defines exports as:
and so:
is translated to:
Another possible fix could be to drop "./dist/*": {
- "import": "./dist/*.js",
+ "import": "./dist/*",
- "require": "./dist/*.js"
+ "require": "./dist/*", However, this alternative approach may or may not have a negative effect on other consumers of Cytoscape, so perhaps you'd like to review #3241 as a temporary solution, and the more general solution upon Max's return? |
Adding @sidharthv96 regarding those patches in mermaid, hopefully they can be removed after this is resolved. |
fix(umd): exported cytoscape.umd, closes #3239
3.29.2 has been released, please let me know if it resolves your issues This issue was auto-closed by the commit in the PR. If there are any further issues please reopen. |
3.29.2 works well, thanks @mikekucera 🚀 |
Environment info
exports
fieldCurrent (buggy) behaviour
In the current behaviour, this package was added an
exports
field to its package.json which doesn't cover all thedist
folder consumble outputs.Desired behaviour
I would be able to directly consume any dist file e.g
Minimum steps to reproduce
Use the latest version and have this simple test file:
I would expect anything I can consume would be covered over the
exports
field 👍For example the following condition would be sufficient ->
For reviewers
Reviewers should ensure that the following tasks are carried out for incorporated issues:
master
,unstable
, and1.1.x
if the current release is 1.2).bug
, if necessary.The text was updated successfully, but these errors were encountered: