Closed Vithanco closed 1 year ago
Thanks for the kind words. Sorry about this. I hope I've fixed it in v5.0.1. I don't know how to test it. All this package.json
stuff is a bit of black magic to me.
Please let me know how it goes.
I am new to the world of Javascript myself, hence I totally get the black magic part. On top, it is a struggle with a constantly evolving stack.
I changed your package.json locally to
"type": "module",
"exports": "./index.js",
"main":"./index.js",
"jsnext:main": "index",
which was fixing the next issue.
I assume that jsnext:main
would benefit from the .js
but I don't really know.
sorry, forgot to mention that the package wasn't accessible at all without this local change.
Is this with v5.0.1? If so, you might want to go through https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c to ensure your application can handle pure ESM. Does it work with D3 v7?
I see now that e.g. d3-selection
uses:
"main": "src/index.js",
Maybe the FAQ is wrong?
Wait a minute, perhaps
"exports": "./src/index.js",
is the culprit? There's no such file. I see now that you've changed that as well. Do you need also the "main" and "jsnext:main" entries to make it work?
That part I don’t know neither, but I assume so
On Tue, 27 Dec 2022 at 16.51, Magnus Jacobsson @.***> wrote:
Wait a minute, perhaps
"exports": "./src/index.js",
is the culprit? There's no such file. I see now that you've changed that as well. Do you need the "main" and "jsnext:main" entries to make it work?
— Reply to this email directly, view it on GitHub https://github.com/magjac/d3-graphviz/issues/263#issuecomment-1366004066, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFFOMD5KUMPJEDO2ZZDIU3WPMGAXANCNFSM6AAAAAATJ4A7BA . You are receiving this because you authored the thread.Message ID: @.***>
-- Klaus Kneupner http://www.kneupner.de "Denn von allen Gedanken, schätz' ich doch am meisten, die interessanten" Die Sterne
Can you try without and let me know?
I tried earlier, and struggled with the whole. I undid my changes and it worked.., didn’t make sense. I suggest you wait until someone with more experience complaints 😇
On Tue, 27 Dec 2022 at 18.23, Magnus Jacobsson @.***> wrote:
Can you try without and let me know?
— Reply to this email directly, view it on GitHub https://github.com/magjac/d3-graphviz/issues/263#issuecomment-1366060464, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFFOMA2UV5DJN5W3VSAVX3WPMQ2LANCNFSM6AAAAAATJ4A7BA . You are receiving this because you authored the thread.Message ID: @.***>
-- Klaus Kneupner http://www.kneupner.de "Denn von allen Gedanken, schätz' ich doch am meisten, die interessanten" Die Sterne
I released v5.0.2 with a fix for the "exports" problem. I also added a test so it won't happen again. Hopefully this works for you.
It does! Thank you so much. I am well impressed by your speed and attention.
Hi Magjac! Thanks for version 5.0.0. Great work! Tried to make use of it and run into issue. Hope it's a real issue and I don't waste your time.
I get the error message
Failed to resolve entry for package "d3-graphviz". The package may have incorrect main/module/exports specified in its package.json.
Not fully sure what it means, but my understanding is that the main definition in package.json is faulty. I found these parts in package.json that all look slightly odd:
Two things that I see that might be tricky.
Type
ismodule
but main file is cjs, so CommonJS, aka notmodule
.How to reproduce? I use the package in Vita setup, and it is the
vite:import-analysis
plugin that is throwing the issue.Thanks! Klaus