Comments (5)
Should JS Interop from JS -> .NET work in a BlazorWorker?
Yes I'm pretty sure this should work.
I think this is a bug introduced when migrating to net8. Also, I can't find the test. Probably means its not covered by a test anymore. I'll try to find to time to debug this week
from blazorworker.
This has been released.
from blazorworker.
Seems like const serializer = new BlazorWorkerJSRuntimeSerializer();
is not recognized in the constructor here.
Getting the exception on 4.1.2 again.
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'serialize')
at BlazorWorkerJSRuntime.js:11:52
at new Promise (<anonymous>)
at DotNetObjectProxy.invokeMethodAsync (BlazorWorkerJSRuntime.js:9:16)
at self.createSubscription (dxfeed.js:44:18)
at Object.workerInvokeAsync [as WorkerInvokeAsync] (BlazorWorkerJSRuntime.js:73:26)
at invoke-js.ts:201:31
at Ul (invoke-js.ts:276:5)
at dotnet.native.wasm:0x1faef
at dotnet.native.wasm:0x1bf8c
at dotnet.native.wasm:0xf173
```
from blazorworker.
To call static methods, line 7 and 8 in the example from my pr should work already in current version. However calling instance methods with DotNetObjectReference
was completely broken, but I'm confident this PR will fix it. I'll see if I have the time to test this a tad more and create a release next week. In your example code you mixed up the concepts a bit as you are trying to call a static
method using a DotNetObjectReference
from blazorworker.
Thanks! Tested today with the DotNetObjectReference
method fix in your PR and is working now. Seems like my example was leftover code after trying to refactor to JSExport, thanks for correcting! Will defo use the next release when you merge. Also kudos for the JSDirect implementation, as will replace a bunch of chained calls my code to hit the main js! Top work!
from blazorworker.
Related Issues (20)
- Only globalization-invariant mode is supported in the WorkerService HOT 5
- BlazorWorker does not work in net6 with published release HOT 11
- Odd exception thrown in WASM-WORKER when instantiating worker service: Missing Assembly System.Net.Http HOT 4
- SerializeLinqExpressionSerializer.cs - no matching element HOT 8
- Sample request - BlazorWorker interacting with in-page JavaScript HOT 1
- Webworker with stimulsoft HOT 2
- Any nuget-released planned including environment variable for culture? HOT 1
- Worker filesystem access HOT 1
- System.ArgumentException: The object must be a runtime Reflection object. -On Simple Service creation HOT 1
- Non-RPC Access HOT 1
- Cannot be initialized when not on `/` HOT 6
- .NET 7 Support? HOT 27
- nuget.org releases missing? HOT 3
- Net8 Support -- BlazorWorker: Unable to locate dotnetjs file in blazor boot HOT 10
- Understanding Worker and BackgroundService instances HOT 6
- Can I pass structured data to Worker? HOT 4
- Add to documentation: Method called via LINQ expression must not be internal HOT 3
- CreateBackgroundServiceAsync
- Early .net9 support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazorworker.