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

Package Json wrong #66

Open
jogibear9988 opened this issue Nov 19, 2022 · 9 comments
Open

Package Json wrong #66

jogibear9988 opened this issue Nov 19, 2022 · 9 comments
Labels
needs investigation This item needs to be looked into, additional content from issue submitter would help as well.

Comments

@jogibear9988
Copy link

jogibear9988 commented Nov 19, 2022

I wont to include your npm modules directly as esm but your package json is wrong.

the export: "module" points to "dist/index.js"
wich has this code:

  export * from './esm-es5/index.js'; 

but the index.js in esm-es5 is empty

@chris-demartini chris-demartini added the needs investigation This item needs to be looked into, additional content from issue submitter would help as well. label Dec 7, 2022
@jogibear9988
Copy link
Author

any news to this?
I try to use your components in my designer: https://node-projects.github.io/web-component-designer-demo/index.html
But for this the exports need to be correct.

@david-kutas
Copy link
Contributor

Thanks for sharing this with us. I'm one of the maintainers of the project.

Could you please provide me with a simple reproduction where you run into this issue?

@jogibear9988
Copy link
Author

As I explained, I create a Designer wich directly can load npm packages from unpkg (or other providers). It then parses the package.json, loads dependecies and at last loads the exports from the package.json

If you look at your package.json here: https://www.npmjs.com/package/@visa/charts?activeTab=explore
you see, your "main" export is "dist/index.cjs.js" but if you use es6 modules, you normaly look for the "modules" exoport in the package.json, wich leads to "dist/index.js" wich then leads to the empty import.
The cjs export cannot directly be used by the browser. Also the package.json normaly shoul export the es6 code via "export" definition. But at first your "modules" export should work

@jogibear9988
Copy link
Author

also when you look at your other export "dist/esm/index.js", it is also empty

@jogibear9988
Copy link
Author

@david-kutas
Copy link
Contributor

Thank you for the explanation, we are investigating the issue. I'll get back as soon as I have some sort of a recommendation/resolution to the issue.

@david-kutas
Copy link
Contributor

david-kutas commented Feb 7, 2023

Just an extra thought: Would there be a way for you to overwrite the default import behavior on your side (within your designer application)?

@jogibear9988
Copy link
Author

i wrote the import behavior, as it i defined in node.
why do you deliver empy javascript files?
ad I cannot load cjs from the browser.
from where should I know wich files to load in your library?

@david-kutas
Copy link
Contributor

Thank you for the inputs. We are further investigating the problem. As soon as I have some details on this, I'll get back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation This item needs to be looked into, additional content from issue submitter would help as well.
Projects
None yet
Development

No branches or pull requests

3 participants