No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    how to load webworker file

    Help
    boot externallink webworker
    2
    3
    293
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tc last edited by

      I want to load the webworker file in the boot file.
      Here is what I did:

      export default function MyWorker(store){
       
        const worker = new Worker('/assets/worker/worker.js');
        console.log('in worker', worker)
        Vue.prototype.$worker = worker
      }
      

      The file is 404 not found.
      I tried with

      '../assets/worker/worker.js'
      '/statics/worker/worker.js'
      '../statics/worker/worker.js'
      

      All not working.
      I even tried with load the file from index.js, still not working.
      Anyone know how to do it properly?

      dobbel 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel @tc last edited by

        @tc said in how to load webworker file:

        const worker = new Worker(’/assets/worker/worker.js’);

        did you try this:

        const worker = new Worker('statics/worker/worker.js');
        
        T 1 Reply Last reply Reply Quote 0
        • T
          tc @dobbel last edited by

          @dobbel Yes. I did. Still not working.

          I end up using workerize-loader .

          1 Reply Last reply Reply Quote 0
          • First post
            Last post