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

ES module version of NPM package incomplete #8

Open
uoc-kpf opened this issue Apr 18, 2024 · 1 comment
Open

ES module version of NPM package incomplete #8

uoc-kpf opened this issue Apr 18, 2024 · 1 comment

Comments

@uoc-kpf
Copy link

uoc-kpf commented Apr 18, 2024

Hi, I'm getting the following error message when I try to build the package.

npm run build

> build
> vite build

vite v4.5.3 building for production...
✓ 1 modules transformed.
✓ built in 91ms
[commonjs--resolver] Failed to resolve entry for package "@maptiler/leaflet-maptilersdk". The package may have incorrect main/module/exports specified in its package.json.
error during build:
Error: Failed to resolve entry for package "@maptiler/leaflet-maptilersdk". The package may have incorrect main/module/exports specified in its package.json.
    at packageEntryFailure (file:///var/www/locations/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28725:11)
    at resolvePackageEntry (file:///var/www/locations/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28722:5)
    at tryNodeResolve (file:///var/www/locations/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28453:20)
    at Object.resolveId (file:///var/www/locations/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:28212:28)
    at file:///var/www/gdar-locations/node_modules/rollup/dist/es/shared/node-entry.js:25544:40
    at async PluginDriver.hookFirstAndGetPlugin (file:///var/www/locations/node_modules/rollup/dist/es/shared/node-entry.js:25444:28)
    at async resolveId (file:///var/www/locations/node_modules/rollup/dist/es/shared/node-entry.js:24117:26)
    at async ModuleLoader.resolveId (file:///var/www/locations/node_modules/rollup/dist/es/shared/node-entry.js:24531:15)
    at async Object.resolveId (file:///var/www/locations/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:7910:10)
    at async PluginDriver.hookFirstAndGetPlugin (file:///var/www/locations/node_modules/rollup/dist/es/shared/node-entry.js:25444:28)

It looks like the dist directory is missing from node_modules/@maptiler/leaflet-maptilersdk.

@uoc-kpf uoc-kpf changed the title ES module version of NPM package not installing ES module version of NPM package incomplete Apr 18, 2024
@sebstryczek
Copy link
Contributor

Hello @uoc-kpf thank you for your patience. I understand it was almost a year but we were in the middle of low-level improvements of our SDK and we really wanted to investigate your issue.

Unfortunately I am not able to reproduce it easily. I can see that you were using vite v4.5.3 and probably leaflet-maptilersdk v2.0.0 - could you please prepare a minimal example presenting the issue and share it with us?

BTW. We just released v4.0.2 which adds TypeScript support. You could take a look and check if the issue occurs in this version as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants