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

How can I use api calls in useWorker? #116

Open
KbnCodes opened this issue Sep 2, 2021 · 1 comment
Open

How can I use api calls in useWorker? #116

KbnCodes opened this issue Sep 2, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@KbnCodes
Copy link

KbnCodes commented Sep 2, 2021

[Required] Describe the bug
I need to get data from backend and store that large amount of data to indexeddb , But issue is when iam using axios or fetch iam getting error , is there any other option to invoke api calls ?

"Uncaught ReferenceError: axios__WEBPACK_IMPORTED_MODULE_2___default is not defined" --- this error getting when using axios ,

[Required] Expected behavior
is there any inbuild method to call api ? ot any way to import third party library like axios

[Optional] Screenshots

[Optional] Device (please complete the following information):

  • OS: [Windows]
  • Browser [chrome]

[Optional] context
Add any other context about the problem here.

@KbnCodes KbnCodes added the bug Something isn't working label Sep 2, 2021
@croatialu
Copy link

remoteDependencies,以及不要直接使用 import 导入的变量名

参考: https://github.com/CroatiaParanoia/tortoise/blob/master/src/App.tsx#L7

如上可以解决你的问题(至少我的 SparkMD5 可以正常使用)

另外如果有更好的实现,可以告知我一下, 不甚感激

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants