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

Throwing error when requesting #74

Closed
OceanTechnic opened this issue Jan 7, 2023 · 2 comments
Closed

Throwing error when requesting #74

OceanTechnic opened this issue Jan 7, 2023 · 2 comments

Comments

@OceanTechnic
Copy link
Contributor

OceanTechnic commented Jan 7, 2023

Error trace

npm run server[25984]: c:\ws\src\tcp_wrap.cc:155: Assertion `args[0]->IsInt32()' failed.
1: 00007FF6ED25151F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+121999
2: 00007FF6ED1DB386 DSA_meth_get_flags+64118
3: 00007FF6ED1DB741 DSA_meth_get_flags+65073
4: 00007FF6ED0F220F v8::internal::HashTable<v8::internal::GlobalDictionary,v8::internal::GlobalDictionaryShape>::HashTable<v8::internal::GlobalDictionary,v8::internal::GlobalDictionaryShape>+23039
5: 00007FF6EDACD656 v8::internal::Builtins::code_handle+172806
6: 00007FF6EDACCECE v8::internal::Builtins::code_handle+170878
7: 00007FF6EDACD4F7 v8::internal::Builtins::code_handle+172455
8: 00007FF6EDACD370 v8::internal::Builtins::code_handle+172064
9: 00007FF6EDBA0A51 v8::internal::SetupIsolateDelegate::SetupHeap+494641
10: 00007FF6EDB30506 v8::internal::SetupIsolateDelegate::SetupHeap+34534
11: 00007FF6EDC30476 v8::internal::SetupIsolateDelegate::SetupHeap+1082966
12: 00007FF6EDB32F1E v8::internal::SetupIsolateDelegate::SetupHeap+45310
13: 0000016E1EF1BDC8

Node version 16 and higher
Version 14 will throw fetch is not a function in udici

Maybe somehow related?
nodejs/node#35572
nodejs/undici#448

@Linux123123
Copy link
Owner

https://github.com/nodejs/undici#undicifetchinput-init-promise

I believe undici.fetch method is only available in Node 16.8+. And it is used to request. I remember I tried to implement the undici.request method, but never successfully did, as it doesn't have some features that fetch does.

import { fetch, RequestInit } from 'undici';

I will update engines property of package.json accordingly.

@OceanTechnic
Copy link
Contributor Author

Cool I see your changes eba333e, let me check with my code

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

2 participants