FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
129 stars 26 forks source link

Components imported into custom widget cause erroneous compilation errors #2763

Closed jonl-percsolutions-com closed 6 months ago

jonl-percsolutions-com commented 7 months ago

Has your issue been reported?

Current Behavior

Importing a component, into a custom widget and attempting to use it, causes and erroneous compilation error report by the validating build and compile mechanism.

This did not occur in the prior version of the app.

Expected Behavior

No errors on validating custom widget when using a custom component

Steps to Reproduce

  1. Create a new Custom Component
  2. Create a new Custom Widget
  3. Import and use that Component within the Custom Widget
  4. Run the compile and validate mechanism for Custom Widgets

Reproducible from Blank

Bug Report Code (Required)

https://app.flutterflow.io/project/custom-widget-errors-8ncgiv?tab=customCode&customCodeTab=widgets

Context

This has started occuring after upgrading to the latest version of flutterflow. v4.1.41+ Desktop v4.1.34+ Web

Visual documentation

Linter shows no errors in code, but errors are seen in the compile/validate mechanism

Code

image

Errors

image

Additional Info

No response

Environment

- FlutterFlow version: 4.1.41+ Desktop, 4.4.34+ Web
- Platform: Web/Desktop
- Browser name and version: Edge / Chrome
- Operating system and version affected: Windows 11 / MacOS Sanoma
jonl-percsolutions-com commented 7 months ago

Additional symptom, seems related, in Browser developer tools seeing the following errors related to file analyzation:

FlutterFlow Code Editor: [Error - 8:26:54 PM] Request textDocument/documentColor failed.
monaco-code-editor-dart.bundle.js:2 FlutterFlow Code Editor:   Message: File is not being analyzed
  Code: -32007 
/tmp/ff_service_scratch/custom-widget-errors-8ncgiv/lib/custom_code/widgets/test_custom_widget.dart
monaco-code-editor-dart.bundle.js:2 Error from language server: 1 Request textDocument/documentColor failed.
error @ monaco-code-editor-dart.bundle.js:2
monaco-code-editor-dart.bundle.js:2  [main 2024-04-19T00:26:54.434Z] Error: File is not being analyzed
    at monaco-code-editor-dart.bundle.js:2:2232704
    at monaco-code-editor-dart.bundle.js:2:2232998
    at monaco-code-editor-dart.bundle.js:2:2233360
error @ monaco-code-editor-dart.bundle.js:2
monaco-code-editor-dart.bundle.js:2  Uncaught Error: File is not being analyzed

Error: File is not being analyzed
    at monaco-code-editor-dart.bundle.js:2:2232704
    at monaco-code-editor-dart.bundle.js:2:2232998
    at monaco-code-editor-dart.bundle.js:2:2233360
    at monaco-code-editor-dart.bundle.js:2:450283
paulperez-dev commented 6 months ago

Hi @jonl-percsolutions-com, thank you for your report. Using components inside custom widgets is not a supported feature. Please try creating all the necessary components inside the custom widget instead of importing them.

This tracker is only used for reproducible bugs, so I am closing this issue.

jonl-percsolutions-com commented 6 months ago

Hi @jonl-percsolutions-com, thank you for your report. Using components inside custom widgets is not a supported feature. Please try creating all the necessary components inside the custom widget instead of importing them.

This tracker is only used for reproducible bugs, so I am closing this issue.

@paulperez-dev ,

Saying this is not supported is saying that you don't support packages because everything is a package. I can see the argument for custom functions, where you do not provide custom imports, even though the only technical barrier there is creating an index for components like you do for custom widgets.

But in the realm of custom widgets, custom imports are allowed and encouraged by the web ide. The web based ide will recommend them as imports and show a quick fix to import them.

image

image

image

The code compiles. The code runs. The error is erroneous.

The options, as far as I am concerned are, fix the erroneous message, or remove the functionality in the web ide that recommends the import.