GoogleChromeLabs/worker-plugin

Failed to load module script

alexroldan opened this issue · 1 comments

I've got this error. It is either a bug or am I missing some configuration not documented. I feel, it has something to do with webpack.

Failed to load module script: The server responded with a non-JavaScript, CSS MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

I'm using vue.config.js ... and here is my configuration.

configureWebpack: {
    output: {
        globalObject: "this",
    },
    plugins: [
        new WorkerPlugin({
            globalObject: "self",
            preserveTypeModule: true,
            //workerType: 'foo'
        }),
    ],
},

upon exploring and researching more ... I manage to make it work ... In vuejs, there is the @ sign that correspond to the src url of the file ... @sign tells webpack to add it as its resources ....

const worker= new Worker("@/workers.js", { type: "module" });