developit / developit/workerize-loader
Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': function transformRequest(data, headers) { normalizeHeaderName(headers, 'Accept'); normalizeHeaderName(...<omitted>... } could not be cloned.
- Ngôn ngữ chính
- JavaScript
- Star
- 2.3k
- Fork
- 85
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
I query a large Firebase collection in my app.
I'd like to use `axios` in my app. But it is wrong
`
// worker.js
import axios from "axios";
import 'regenerator-runtime';
export async function expensive() {
const res = await axios.get('https://vdata.amap.com/tiles?mapType=normal&v=3&style=5&key=f97efc35164149d0c0f299e7a8adb3d2&version=1.4.17&rd=2&flds=roadlabel,poilabel&t=9,432,204;9,436,204;9,432,201;9,436,201;9,432,203;9,436,203;9,433,204;9,435,204;9,432,202;9,436,202&lv=9&key=f97efc35164149d0c0f299e7a8adb3d2&preload=0');
console.log(res)
return res;
}
`
When I run the worker as follows:
// app.js
import Worker from 'workerize-loader!./worker';
`
let instance = worker()
instance.expensive().then(data => {
console.log(`${data}`)
})
`
Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': function transformRequest(data, headers) { normalizeHeaderName(headers, 'Accept'); normalizeHeaderName(...... } could not be cloned.
Is it a bug in workerize or is it me doing something wrong?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start with the worker.js and app.js examples, then inspect the workerize-loader!./worker entry point and its message-passing path. Reproduce expensive() with the shown axios request and trace the returned value through postMessage; done means the worker call no longer produces the reported structured-clone error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, webpack
- Lĩnh vực
- tooling, web-dev
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100