JeanLouis Posted August 8, 2023 Share Posted August 8, 2023 Hello Working on mac OS High Sierra with Brave Version 1.56.20 Chromium: 115.0.5790.171 Workers and offscreen canvas works perfecly PIXI 7.2.4 works perfectly Yet, the code below does not work, error : "Unable to auto-detect a suitable renderer". index.html <!doctype html> <html> <body> <script> const canvas = document.createElement('canvas'); document.body.appendChild(canvas); const view = canvas.transferControlToOffscreen(); const worker = new Worker('./worker.js'); worker.postMessage({where:view}, [view]); </script> </body> </html> worker.js self.importScripts("https://cdnjs.cloudflare.com/ajax/libs/pixi.js/7.2.4/pixi.min.js"); self.onmessage = function(args) { const app = new PIXI.Application({ // launches error : "Unable to auto-detect a suitable renderer" width:500, height:500, view:args.data.where }); const container = new PIXI.Container(); // no error, so PIXI is imported successfully } Error with the same with others browsers (firefox and safari). Any ideas ? Thanks ! Quote Link to comment Share on other sites More sharing options...
JeanLouis Posted August 8, 2023 Author Share Posted August 8, 2023 (edited) Finally found it, actually the cdn was wrong, you have to use a specific one for workers : https://cdn.jsdelivr.net/npm/@pixi/[email protected]/dist/webworker.min.js"); Would be best if this would be written in the pixi official page if you ask me : https://pixijs.io/examples/#/offscreen-canvas/web-worker.js Whatever Solved ! Edited August 8, 2023 by JeanLouis Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.