A Possible Limitation with WebAssembly Apps?
A WriteFreely user recently got in touch with me, asking if I could modify the Write.as Archive Page Generator app, to make it work with WriteFreely instances. I spent some time with it last week and I ran into a snag. I'm getting this TypeError: Failed to fetch
JavaScript error whenever it tries to fetch data from the WriteFreely instance I'm testing.
When I try getting posts from a Write.as blog using a Blazor WASM app, it works. When I try getting posts from a WriteFreely instance blog, using the Blazor WASM app, it won't work. But when I try getting posts from a WriteFreely instance blog, using a .NET Core console app that uses the WriteAs.NET library I wrote, the same library that the Blazor WASM app uses, it works. Something weird is going on.
My research into the issue indicates a possible limitation with WebAssembly apps. There must be some security setting on the WriteFreely instance I'm testing, that's blocking my Blazor WASM requests. The Write.as API is obviously not blocking my requests, so something is going on with that WriteFreely instance.
I dug into it some more and found that it is a CORS related issue. But at this point, there's nothing else I could on my end to fix it. I created a thread on discuss.write.as to talk about it.
Tags: #Blazor #JavaScript #WebAssembly
Discuss... or leave a comment below.