You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bootsharp makes malformed bindings.g.js file in some cases when the first namespace name is a part of the second namespace name and parseAst.js fails with a message like Expected ',' got 'export'.
I manged to reproduce this issue with the following toy example:
using Bootsharp;using BootSharpBackendCore;using BootSharpBackendCore.Input;using BootSharpBackendCore.Output;namespace BootSharpBackend;publicstaticpartialclassProgram{publicstaticvoidMain(){}[JSInvokable]publicstaticIReadOnlyList<Bar>Test(Foofoo)=> Facade.Test(foo);}
dotnet publish command will fail, but some of artifacts will remain, so, the bin\Release\net8.0\browser-wasm\AppBundle\_framework\bindings.g.js file will have something like that:
import{exports}from"./exports";import{Event}from"./event";functiongetExports(){if(exports==null)throwError("Boot the runtime before invoking C# APIs.");returnexports;}functionserialize(obj){returnJSON.stringify(obj);}functiondeserialize(json){constresult=JSON.parse(json);if(result===null)returnundefined;returnresult;}exportconstBootSharpBackend={test: (foo)=>deserialize(getExports().BootSharpBackend_Program.Test(serialize(foo)))exportconstBootSharpBackendCore={Input: {Foo: {"0": "Value1","1": "Value2","Value1": 0,"Value2": 1}}};
Thank you!
The text was updated successfully, but these errors were encountered:
Hi @elringus ,
Bootsharp makes malformed
bindings.g.js
file in some cases when the first namespace name is a part of the second namespace name andparseAst.js
fails with a message likeExpected ',' got 'export'
.I manged to reproduce this issue with the following toy example:
and a project with
JSInvokable
:dotnet publish
command will fail, but some of artifacts will remain, so, thebin\Release\net8.0\browser-wasm\AppBundle\_framework\bindings.g.js
file will have something like that:Thank you!
The text was updated successfully, but these errors were encountered: