-
Notifications
You must be signed in to change notification settings - Fork 494
-
I've been trying to set up a simple Blazor web app to deploy to Lambda, but having some issues right off the bat. Wondering what I'm doing wrong.
Following the instructions from this post https://toxigon.com/run-blazor-based-dotnet-web-applications-on-aws-serverless, I:
dotnet new blazorwasm -o BlazorServerlessAppcd BlazorServerlessApp/dotnet run- this works!dotnet add package Amazon.Lambda.AspNetCoreServerdotnet run:Using launch settings from .../BlazorServerlessApp/Properties/launchSettings.json... Building... /usr/share/dotnet/sdk/9.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(512,5): error NETSDK1082: There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'.
No matter what I do after that command, I get the same error trying to build or run. From this StackOverflow post, it would appear that the error means that one of my dependencies is not compatible with the browser-wasm target.
So my question is, how do I host my Blazor app in a Lambda? I'm sure I'm doing something wrong as this seems like a pretty common use case.
System information:
$ dotnet --version 9.0.302
joe@joes-computer
MMMMMMMMMMMMMMMMMMMMMMMMMmds+. OS: Linuxmint 21.3 virginia
MMm----::-://////////////oymNMd+` Kernel: x86_64 Linux 5.15.0-143-generic
MMd /++ -sNMd: Uptime: 5d 6h 55m
MMNso/` dMM `.::-. .-::.` .hMN: Packages: 3570
ddddMMh dMM :hNMNMNhNMNMNh: `NMm Shell: bash 5.1.16
NMm dMM .NMN/-+MMM+-/NMN` dMM Resolution: 7040x1661
NMm dMM -MMm `MMM dMM. dMM DE: GNOME 41.7
NMm dMM -MMm `MMM dMM. dMM WM: Muffin
NMm dMM .mmd `mmm yMM. dMM WM Theme: Mint-Y-Dark-Aqua (Mint-Y)
NMm dMM` ..` ... ydm. dMM GTK Theme: Mint-Y-Dark-Aqua [GTK2/3]
hMM- +MMd/-------...-:sdds dMM Icon Theme: Yaru-blue-dark
-NMm- :hNMNNNmdddddddddy/` dMM Font: Ubuntu 10
-dMNs-``-::::-------.`` dMM Disk: 878G / 946G (98%)
`/dMNmy+/:-------------:/yMMM CPU: 11th Gen Intel Core i7-11800H @ 16x 4.6GHz [67.0°C]
./ydNMMMMMMMMMMMMMMMMMMMMM GPU: NVIDIA GeForce RTX 3050 Ti Laptop GPU
\.MMMMMMMMMMMMMMMMMMM RAM: 6835MiB / 31793MiB
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
The common issue I hear when attempting to deliver the wasm content from the Lambda function is making sure they are being identified as binary content. If you are using version 9.0.1 or later of Amazon.Lambda.AspNetCoreServer it will automatically detect from it's side that wasm content type should be base 64 encoded. The other thing you need to make sure is that your API Gateway is configured for the wasm content type to return the data as binary data.
Beta Was this translation helpful? Give feedback.