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

Adding a Frame.Navigated callback causes "error CS1001: Identifier expected" in generated code #19343

Open
LegacyNsfw opened this issue Jan 28, 2025 · 0 comments
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@LegacyNsfw
Copy link

Current behavior

See repro steps.

Expected behavior

A clean build.

How to reproduce it (as minimally and precisely as possible)

See https://github.com/LegacyNsfw/UnoExample-1

Repro steps:

  1. Create a new Uno project with all of the default settings
  2. Get a successful build (just to be sure)
  3. In MainFrame.xaml, add a new grid row, and add this:
  4. In MainModel.cs, add this: public Task Navigated() { return Task.CompletedTask; }
  5. Build again

Results:

\obj\Debug\net8.0-desktop\Uno.UI.SourceGenerators\Uno.UI.SourceGenerators.XamlGenerator.XamlCodeGenerator\MainPage_f433d2c1faa000eaf5b2bdd8acb5c9b7.cs(185,129,185,130): error CS1001: Identifier expected

The same error is repeated for each of the targets (browser, android, ios, etc).

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

Visual Studio 2022

IDE version

Version 17.12.3

Relevant plugins

Uno platform extension 1.0

Anything else we need to know?

The generated file was deleted by the build process, otherwise I'd include it here.

On a related note, I'd prefer that those generated files were not deleted. That's partly because it would help diagnose Uno issues like this one, but also because they might be be helpful in troubleshooting issues in application code. I've found a few ways to confuse the code generator with mistakes in my own code, and it's always hard to identify the root cause, because the build errors happen in generated code that gets deleted.

@LegacyNsfw LegacyNsfw added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

1 participant