Closed bsastregx closed 1 year ago
Nano ID has 2 versions: for browser and for Node.js.
Seems like your bundler didn’t change the file to browser’s version. I recommend you to ask help in your bundle’s community about using package.browser
and package.exports
.
Another [bad] way is to use import { nanoid } from 'nanoid/index.browser.js'
@ai Thanks! When you say ask for help in my bundle's community, where exactly do you mean? can you provide a url?
@ai Thanks! When you say ask for help in my bundle's community, where exactly do you mean? can you provide a url?
What bundler are you using? (webpack, rollup, vite (via rollup), etc...)
I understand, now. Thanks!
Hi, I am getting the following error on a project I am using nanoid:
Error while transforming node_modules/nanoid/index.js: Could not resolve import "crypto".
I am using nanoid on a Lit-element project : https://lit.dev/