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

does not provide an export named 'nolookalikes' #10

Closed
technicallybo opened this issue May 3, 2021 · 3 comments
Closed

does not provide an export named 'nolookalikes' #10

technicallybo opened this issue May 3, 2021 · 3 comments

Comments

@technicallybo
Copy link

I am running a react app (with snowpack). I previously used with create-react-app (webpack) and it worked, but when I migrated to snowpack I got the following error. Not sure the bundlers make the difference, but just mentioning for reference.

-- my code --
import { customAlphabet } from 'nanoid';
import { nolookalikes } from 'nanoid-dictionary';
export const CreateId = customAlphabet(nolookalikes, 3);

-- my error (react/snowpack) --
Uncaught SyntaxError: The requested module '../../_snowpack/pkg/nanoid.v3.1.22.js' does not provide an export named 'nolookalikes'

Wondering if anyone has run into a similar problem. I originally thought this library was connected (directly) with nanoid, but I guess maybe not. They had what I think is a similar/related issue? See:
Error: No valid exports main found for 'node_modules\nanoid' #206
ai/nanoid#206

Also, nanoid function works when not used with nanoid-dictionary.

@CyberAP
Copy link
Owner

CyberAP commented May 5, 2021

Thanks for pointing the issue, it's caused by having all the code written in common js modules. I've rewritten the code in ES modules and it should work fine now. I've published a beta 5.0.0-beta.1 version to try it out. You can install it with npm i nanoid-dictionary@beta. Could you please try out the beta and verify that it works now?

@technicallybo
Copy link
Author

I installed the beta and it resolved the issue with imports. Thanks!

@KaKi87
Copy link

KaKi87 commented Mar 3, 2024

Hi,
Will v5 become stable anytime soon ?
Thanks

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

3 participants