-
Notifications
You must be signed in to change notification settings - Fork 22
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
importing in typescript project does not work #72
Comments
using |
Does this work: I include these exports in the package.json: Lines 5 to 9 in 37ca663
that I build using rollup like this: maplibre-contour/rollup.config.js Lines 40 to 43 in 37ca663
I'm not quite sure which it's picking up when you do import |
Quick update... using that line of code, everything compiles without errors, but then in the browser the following error is thrown...
|
Nope sorry.
still throws... I ended up loading the "maplibre-contour.min.js" file on demand via vanilla javascript and am not using TS typings for the mlcontour lib. |
I'm trying to reproduce this issue in a minimal test project to make sure it works in CI - can you see what's different from this test project to yours so I can reproduce the issue? https://github.com/onthegomap/maplibre-contour/tree/test-build/test-project |
I have a similar issue and found out that the issue is related to You can run the below command inside the test-project and it should fail. npx esbuild index.ts --bundle
|
OK I think I fixed this in #146 - try using version 0.0.6. |
I can confirm that with v0.0.6 the "maplibre-contour" import is now working as expected in my project. Thank you! |
using publint reports missing types: https://publint.dev/[email protected] I ended up having to switch to |
I'm trying to use the maplibre-contour library in my typescript file, but I'm getting a compiler error:
installed it with yarn
yarn add maplibre-contour --save
Here is the code snippet:
Could it be that the "maplibre-contour" es6 module only exports types and not the actual code?
The text was updated successfully, but these errors were encountered: