deakjahn / flutter_isolate_web Goto Github PK
View Code? Open in Web Editor NEWUnified interface to isolates and web workers.
License: MIT License
Unified interface to isolates and web workers.
License: MIT License
For instance, where should these lines to be:
worker.spawn(
doWork,
name: 'some-unique-name',
onInitialized: onInitialized,
onFromWorker: onReceive,
);
Hi, I created worker.js
at project/web/worker.js
file with this content:
onmessage = function(e) {
console.log('Message: ', e);
postMessage('Hello');
};
I updated worker_web.dart
to with the following:
static String source = "importScripts('worker.js');";
And I did get this error:
Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The URL 'worker.js' is invalid.
at blob:http://localhost:63131/69d4c045-0884-490e-90b0-a1b983bd7934:1:1
Even though when in development mode I can access the file directly with no issue, like this: http://localhost:63131/worker.js
, and still there is an error. Why?
worker_web.dart
to with the following:static String source = "importScripts(location.origin + '/worker.js');// entryPoint();";
and I did get this error:
629f3507-351a-49cb-ba6b-89e7e0177e9b:1 Refused to execute script from 'http://localhost:53629/worker.js' because its MIME type ('application/octet-stream') is not executable, and strict MIME type checking is enabled.
Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:53629/worker.js' failed to load. at blob:http://localhost:53629/629f3507-351a-49cb-ba6b-89e7e0177e9b:1:1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.