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

NPM package import error. #26

Open
edgar-505 opened this issue Nov 11, 2023 · 5 comments
Open

NPM package import error. #26

edgar-505 opened this issue Nov 11, 2023 · 5 comments

Comments

@edgar-505
Copy link

edgar-505 commented Nov 11, 2023

Hi , I tried to import the package import { Flip } from "number-flip" to my framer project and this happens :

Screenshot 2023-11-11 at 21 50 40

my current hunch is that maybe the package is not ESM compatible.
so, is the package ESM compatible?

@gaoryrt
Copy link
Owner

gaoryrt commented Nov 20, 2023

Yes, it is. Maybe you missed to install the package first?

@edgar-505
Copy link
Author

Yes, it is. Maybe you missed to install the package first?

framer (the app) tries to install the package , but it failed to import the package.
but I found a work-around , so I copied the whole source code from number-flip.ts
then paste it to my own file , then I refer my import to my own local file.

the package is not verified in their app , maybe.

@gaoryrt
Copy link
Owner

gaoryrt commented Nov 23, 2023

Yes, it is. Maybe you missed to install the package first?

framer (the app) tries to install the package , but it failed to import the package. but I found a work-around , so I copied the whole source code from number-flip.ts then paste it to my own file , then I refer my import to my own local file.

the package is not verified in their app , maybe.

I think that dist/index.js is suitable for Webpack/Gulp.

@edgar-505
Copy link
Author

I think that dist/index.js is suitable for Webpack/Gulp.

so , should I copy the whole thing dist/index.js or from number-filp.ts ?

@gaoryrt
Copy link
Owner

gaoryrt commented Nov 28, 2023

so , should I copy the whole thing dist/index.js or from number-filp.ts ?

It depends on whether your development environment includes a ts explainer. If it support ts, number-flip.ts is good. But dist/index.js just works for both.

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

2 participants