FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
105 stars 18 forks source link

Enum named "Visibility" causes unknown Compilation error for Custom Widgets #2794

Open reghta opened 2 months ago

reghta commented 2 months ago

Has your issue been reported?

Current Behavior

When I save an Enum named Visibility, the Custom Widgets start throwing compilation errors even if not using that Enum.

"Unknown error compiling custom code. A common cause is a custom widget or action whose name in the code does not match the name provided in the editor."

Expected Behavior

Enums with any name should be created without leading to compilation errors or a clear error should be thrown to why the widget is failing. I have had created the Enum long time ago so when even the simplest Custom Widget had failed, it was very difficult to identify Enum being the source of the issue.

Steps to Reproduce

  1. Create a new project
  2. Create a new Custom Widget, use the boilerplate code, compile and see that it works
  3. Create an Enum named "Visibility" and add any values
  4. Navigate back to the Custom Widget, compile again by making a minor change and see that it throws the unknown error.

Reproducible from Blank

Bug Report Code (Required)

IT4szMrl25F2rtxE0LruY8dB/SUvOUg5R7gWscp/bxIgGIDzPOw+ZPWlXFdBOcujYXw/P0Smmls1wNWLid7AV/ApOQ2dbLpJ+cxQcQ3JTnG5a5OBBpCOdHwnAcBWIG610J+7rRNvBMZtSmQG7EyxN+ytbCjcNpu2IndISq/LZO4=

Context

I was not able work for the last week, as it was very difficult to understand the issue and I had created a new project proceeding step by step to identify the issue.

https://community.flutterflow.io/ask-the-community/post/unknown-error-compiling-any-custom-widget-YTY2uv8dX1Bb5DI

Visual documentation

Screenshot 2024-04-23 at 11 06 49 PM Screenshot 2024-04-23 at 11 06 58 PM

Additional Info

No response

Environment

- FlutterFlow version: 4.1.34+ Flutter 3.19.1
- Platform: Web and MacOS app, both
- Browser name and version: Chrome Version 123.0.6312.124 (Official Build) (arm64)
- Operating system and version affected: MacOS 14.1.2 (23B92)

General

Relative to the time the changes were made, data was lost within

When following my steps to reproduce, data loss happens

rzambroni commented 2 months ago

Hi @rehahoshanli, i was able to replicate the issue you are describing. It might be related to the word "Visibility" being reserved and causing issues with new widgets.
Will send it to the team so they can add the necessary validations. Please avoid that word for now until we have more information about it.

Thanks for the report.

reghta commented 1 month ago

hi @rzambroni The same widget started to throw the same error since yesterday even though the Visibility had been removed and other Enums have not changed, has there been any changes implemented related to this? "Unknown error compiling custom code. A common cause is a custom widget or action whose name in the code does not match the name provided in the editor."