-
Notifications
You must be signed in to change notification settings - Fork 33
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
bug: not importable via script tag from CDN #296
Comments
Hmm I get bundlephobia error with all other libp2p libs: Why aren't you importing, in your example, noise like all other dependencies from |
@mpetrunic because it doesn't exist. maybe that's the bug? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
even the URL from your README.md is throwing an error:
see ipfs-examples/helia-examples#13 where the only module I couldn't import via unpkg, skypack, or jsdelivr is this package.
when importing from typical CDNs, the files are not appropriately configured for ESM imports on the web, and you will get errors like:
import {noise} from 'https://cdn.jsdelivr.net/npm/@chainsafe/libp2p-noise@11.0.1/dist/src/index.js'
->Uncaught TypeError: Failed to resolve module specifier "it-pb-stream". Relative references must start with either "/", "./", or "../".
<script src="https://cdn.jsdelivr.net/npm/@chainsafe/libp2p-noise@11.0.1/dist/src/index.js" type="module" defer></script>
->Uncaught TypeError: Failed to resolve module specifier "it-pb-stream". Relative references must start with either "/", "./", or "../".
In order to import from CDN, the best provider I found was esm.sh via `import { noise } from 'https://esm.sh/v111/@chainsafe/libp2p-noise@11.0.1/es2022/libp2p-noise.js'
The text was updated successfully, but these errors were encountered: