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

TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed. #1398

Open
Yidasvc opened this issue Jun 7, 2024 · 1 comment

Comments

@Yidasvc
Copy link

Yidasvc commented Jun 7, 2024

I use pthread support of emcc. Compiler generated *.worker.js as WebWorker routine. In *.worker.js, createObjectURL was called with its old usage. However, old usage has been removed from browser engine.
截屏2024-06-07 23 18 57
Old usage:

URL.createObjectURL(blob);

New usage:

URL.createObjectURL(new Blob([blob],{type: 'application/zip'})); // value of "type" should be MIME type.

Compile command:

em++ main.cpp -O3 -s WASM=1 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=2 -o $(WASM_JS)

main.cpp:

#include <stdio.h>
#include <emscripten/emscripten.h>
#include <pthread.h>

void* EMSCRIPTEN_KEEPALIVE routine(void* param){
    printf("Routine\n");
    return NULL;
}

int main(int argc, char **argv)
{
    printf("Hello WASM\n");
    pthread_t pthread;
    pthread_create(&pthread, NULL, routine, NULL);
    pthread_join(pthread, NULL);
}

Error in chrome console:
截屏2024-06-07 23 17 37

@sbc100
Copy link
Collaborator

sbc100 commented Jun 8, 2024

This code path changes at lot in 3.1.58 (the worker.js file was actually removed completely). Can you try rebuilding and see if you are still effected?

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