Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot reload in Visual Studio breaks DotVVM binding compilation #1648

Open
OronDF343 opened this issue May 18, 2023 · 1 comment
Open

Hot reload in Visual Studio breaks DotVVM binding compilation #1648

OronDF343 opened this issue May 18, 2023 · 1 comment

Comments

@OronDF343
Copy link
Contributor

Hot Reload can break value bindings to Nullable<T> as well as certain others when the page markup is (re)compiled. The compilation fails with the exception System.NotSupportedException: Method BoxingUtils.Box cannot be translated to Javascript.

The shortest repro example is:

{{value: DateTime.Today.Year}}

Usually I experience this with any binding to a property of type int?, for example:

public int? TestProp { get; set; } = 12345;
{{value: TestProp}}
  1. Debug the application in Visual Studio
  2. Make any small change in the code, anywhere in the application. For example, add a useless local variable to a method somewhere
  3. Click the Hot Reload button (flame icon)
  4. Optional: To make sure that the example page will be recompiled, change the content of the dothtml slightly in any way. This is not necessary if the page wasn't compiled yet
  5. Browse to the example page. Compilation will fail

Here is the full error page from my environment:
dotvvm-error-NotSupportedException.zip

@OronDF343
Copy link
Contributor Author

As of the latest version, the exception message has changed slightly:

System.NotSupportedException:
Method DotVVM.Framework.Utils.BoxingUtils.Box(int? v) -> object cannot be translated to Javascript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant