-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Problems with CBOR in Angular App #148
Comments
As a work-around // eslint-disable-next-line no-unused-vars
const process = require('process') I'll see if I can fix it so you don't need it in the future. |
Thanks, I'll try that out. So a dependency is missing, could those be automatically resolved by npm? The following dependency is also missing:
I also get the following warning (should I open an own issue for it):
|
I'm using typescript for my Angular app. This is how I'm importing the necessary imports from
I tried the following for
|
Did you add process as a dependency? Yes, you'll probably also need bignumber.js as a dependency until I land the fix for #140 in the next major release (which I'm getting very close to having a PR for. Follow my work in the |
Please have a look at my repo here: https://github.com/dibog/angular-cbor Its basically a freshly created Angular App (
Still same error. I really would like to use your library, but it so far I'm not successfull with my tries. |
I'm just pulling it down now, thanks for cutting the repro down. I can't reproduce needing |
What version of node are you using? |
|
I think the issue is that your setup is using an old webpack version that is pulling in the
util and fix this problem more completely. If it does, I'll accelerate moving to a release of cbor@8 this afternoon instead.
|
Cool. I also try to setup a similiar project with newer node/npm version.
Am Fr., 16. Juli 2021 um 18:16 Uhr schrieb Joe Hildebrand <
***@***.***>:
… I think the issue is that your setup is using an old webpack version that
is pulling in the util package, which then includes process. You can see
the work-around I used in
https://github.com/hildjj/node-cbor/blob/e3b17d1980dd4656505c575c9bc9d65148d40af1/packages/webpack-demo/webpack.config.js#L17
(combined with pulling node-inspect-extracted into the HTML file), but I
don't know how to do that in angular. I'll have a chance to look for a
work-around this afternoon, but I think moving to the node12required branch
will remove all traces of util and fix this problem more completely. If
it does, I'll accelerate moving to a release of ***@***.*** this afternoon
instead.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#148 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIC3IVT4VH7KLFB32MT56LTYBLOZANCNFSM5AM6YZ6A>
.
|
With the newest npm and node for windows it does not even compile.
|
Nod. Ok, I think the next major release should fix all of that (I hope). I'm surfing (what I hope is) the last set of changes right now, so will ping you when I have a release candidate to test. In the meantime, can you update your test repo with the modern version, perhaps on a branch so we can switch back and forth? |
Try this: npm add https://gitpkg.now.sh/hildjj/node-cbor/packages/cbor-web\?node12required and remove (this is just to see if it works. I don't know angular enough to be able to tell if this fixed the problem :( ) |
Looking forward to it. Do you have any idea when you have such release candidate? |
I'll try that out, but probably not before monday. Thanks! |
So its now Friday and not Monday :-) Taken your last post into account I was able to start my app. On decoding I got the following error:
The message I got is from a python backend. I assume the CBOR message is valid, but I can't prove it. :-) |
We've made good progress at least. :)
|
Hi Joe, I looked it up. I put a
and I got in the log:
|
add an |
Hi Joe,
I oversaw that the method was an async one.
Yes, with the await it works.
Am Mo., 26. Juli 2021 um 18:03 Uhr schrieb Joe Hildebrand <
***@***.***>:
… add an await blob.arrayBuffer() in there? I may add support for Blob
directly if we get this working.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#148 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIC3IRJJCK64DXKKYZ6UL3TZWBOXANCNFSM5AM6YZ6A>
.
|
I tried to use 'cbor-web' in an Angular Frontend.
But when I type
ng build
I get the following error:The text was updated successfully, but these errors were encountered: