-
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
TypeError: encode is not a function #79
Comments
Are you trying to do this in Node or in the browser? With Node, you would typically download it by using |
I'm developing an extension for chrome with pure js not node js or etc.
I'm not using any module loader.
I just added js file to my project and imported in my js file.
…On Mon, May 15, 2023, 20:09 Kris Zyp ***@***.***> wrote:
Are you trying to do this in Node or in the browser? With Node, you would
typically download it by using npm install cbor-x and then import ...
from 'cbor-x'. If you are using this in the browser, are you using any
module loader/bundler? (could be the same route based on what you are
using).
—
Reply to this email directly, view it on GitHub
<#79 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCDJPDKJTWTSVMJDZOO6ADXGJL2RANCNFSM6AAAAAAYCA32XU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
If you are using a platform that supports ESM, you should be able to directly import encode.js. |
You mean I just import encode.js? |
Yes, like |
Hello there, I'm new in js. I've downloaded index.js from here : https://www.jsdelivr.com/package/npm/cbor-x?tab=files&path=dist
and imported in my js file like this :
import * as CBOR from './src/js/cborx.js'
but when I call CBOR.encode(data) it throws :
Uncaught (in promise) TypeError: CBOR.encode is not a function
How it can be fixed?
The text was updated successfully, but these errors were encountered: