Open AdrKacz opened 5 days ago
Hello!
In this case, you can enable the "Exclude from Compilation" option in the right toolbar. This will prevent the error from appearing in the builder. Please note that this option is specifically for bypassing error checks during compilation.
Thank you for your response!
While selecting "Exclude from compilation" does silence the errors, it still makes working with custom widgets more challenging.
Could you provide some context on why custom widgets don’t support file imports? When exporting the code, the component's code is included and the import statements don't raise errors.
Could this be due to the compilation environment in FF for custom widgets being different from the runtime environment? If so, could you share any additional details about this?
Thank you!
That's a great question! Unfortunately, I don’t have full insight into how the engineering team sets up the environment inside FlutterFlow files. It’s possible that the file paths differ from their structure when the code is downloaded. This could be why the editor has trouble locating custom widgets when they are added.
Thank you for details. Any chance you could bring this information to the engineering team so we can make sure they made the relative path not available on purpose please? As this might just be a small typo in the path resolution or working folder they use.
Can we access your project?
Current Behavior
When you want to import one of your components in a custom widget code, you'll notice the compilation doesn't work, however running the project works fine, which demonstrate that the compilation step in the code editor is not working fine.
You can find multiple issue on the community about this bug, see this one from more than a year ago for example: https://community.flutterflow.io/custom-code/post/how-to-call-another-component-within-a-custom-widget-i22gxgy4BjsCUqp
Expected Behavior
I expect the compilation and the actual run to either both work or both fail. Moreover, I don't expect the compilation to fail with an "cannot find file" where the file is actually there.
Steps to Reproduce
import '<path to your components>';
Reproducible from Blank
Bug Report Code (Required)
Not applicable
Visual documentation
See community forum.
Environment
Additional Information
No response