This seems to be specifically when using a 8.0 sdk, and a net7.0 project created with dotnet new wasmconsole -f net7.0.
Program.cs(13,6): warning CA1416: This call site is reachable on all platforms. 'JSExportAttribute' is only supported on: 'browser'.
This can be seen in Wasm.Build.Tests.WasmTemplateTests.ConsoleBuildAndRunForSpecificTFM(config: "Debug", extraNewArgs: "-f net7.0", expectedTFM: "net7.0").