ka-weihe/fastest-levenshtein

ESM build not working

Closed this issue · 10 comments

jdpt0 commented

When building with vite, I'm getting this error:

[vite-plugin-pwa:build] Failed to resolve entry for package "fastest-levenshtein". The package may have incorrect main/module/exports specified in its package.json.
error during build:
Error: Failed to resolve entry for package "fastest-levenshtein". The package may have incorrect main/module/exports specified in its package.json.
"module": "./esm/mod.esm.js",

This file does not exist on the published version of fastest-levenshtein:
https://unpkg.com/browse/fastest-levenshtein@1.0.14/

Hence the failure.

jdpt0 commented

@RoXuS Any ideas on this?

FWIW, 1.0.13 seems to have a working ESM build

RoXuS commented

Hey the following MR should fix this: #20

This might be a dumb question but how is 1.0.13/14 available when the package.json in this repo, on master which is the only branch I can see is on 1.0.12 ?

RoXuS commented

Correct, but I am not the maintener, I can't fix that ^^

Sorry, guys! I will fix this now.

I have released a new version. Please let me know if it works now.

jdpt0 commented

@ka-weihe Thanks for the update. Still seeing the same error, unfortunately.

I'm still not seeing the file specified in the package.json ("./esm/mod.esm.js") on the latest published version. Maybe this file is not mapped correctly? Should it be "./esm/mod.js"?

I think you're right. I've published a new version. Sorry about this.

jdpt0 commented

All working now, thanks!