ionited / mask

Mask Core
MIT License
12 stars 0 forks source link

Named export 'Mask' not found. #2

Closed lolcabanon closed 6 months ago

lolcabanon commented 6 months ago

Same thing as https://github.com/ionited/mask-svelte/issues/1.

The problem seems to be gone with @ionited/mask-svelte but not @ionited/mask.

import { Mask } from '@ionited/mask';
[vite] Named export 'Mask' not found.
The requested module '@ionited/mask' is a CommonJS module, which may not support all module.exports as named exports. 

CommonJS modules can always be imported via the default export, for example using

 import pkg from '@ionited/mask';
const {Mask} = pkg;

The workaround (import pkg from '@ionited/mask'; const {Mask} = pkg;) works this time. Up to you to decide if this need a "fix" or not.

Edit : Looks like I've written too fast, import pkg from '@ionited/mask'; const {Mask} = pkg; still does not work! Only import * as Mask from '@ionited/mask'; works.


Pacakage Version
@ionited/mask 0.6.1
@ionited/mask-svelte 0.2.1
node 20.11.1
pnpm 8.15.5
svelte 4.2.12
@sveltejs/kit 2.5.5
vite 5.2.7
typescript 5.4.3
gabrielcursino commented 6 months ago

@lolcabanon fixed with 0.6.2 release!

lolcabanon commented 6 months ago

Screenshot_20240409-234343.jpg

Awesome!

I tried many JS / Svelte masking libs and @ionated/mask is now officially part of my toolbox.

Thanks for your work!