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

Can't import the ES module in Angular #142

Open
ozkoidi opened this issue Sep 13, 2023 · 4 comments
Open

Can't import the ES module in Angular #142

ozkoidi opened this issue Sep 13, 2023 · 4 comments

Comments

@ozkoidi
Copy link

ozkoidi commented Sep 13, 2023

Hello,

I'm trying to import the ES module version of the library in an Angular 15 project and I get the following error:

image

I see that there is an export in package.json but it doesn't seem to work.

Aditional info: I installed the dependency "js-quantities": "^1.8.0" and the devDependency @types/js-quantities": "^1.6.3"

@gentooboontoo
Copy link
Owner

Hi. Could you try import Qty from 'js-quantities';?

@ozkoidi
Copy link
Author

ozkoidi commented Sep 15, 2023

Yes, that works but it doesn't use the ES module version right? Which is the one I'm trying to use

@godind
Copy link

godind commented Oct 25, 2023

Same here!

@godind
Copy link

godind commented Oct 25, 2023

To add more valuable context: using import Qty from 'js-quantities'; works fine but I get the following...obvious I guess!

Warning: /.../.service.ts depends on 'js-quantities'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

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

No branches or pull requests

3 participants