Vue-cli-service serve + Newtonsoft.Json function call causes client-side error

This is probably a long shot but I have the following issue with Vue3 + C# scripting:

I have:

  • A Vue3 app that I’m developing using vue-cli-service serve
  • A C# client resource that uses this vue app
  • The C# resource uses Newtonsoft.Json to serialize json for events sent to the UI

When I run vue-cli-service serve while using specifically JsonConvert.SerializeObject() (or maybe another 3rd party library, untested) I get:

Failed to run a tick for VueUiTemplate: System.BadImageFormatException: Error verifying VueUiTemplate:HideUI (): Cannot load method from token 0x0a00002c for call at 0x000c....

Again, if I just run vue-cli-service-build, the app works perfectly, no errors like this.

I highly doubt some JS build task will suddenly affect your C# resource into not calling an internal method.

I am also highly doubtful but if I run the service, the errors happen, if I don’t, they don’t.