FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
124 stars 24 forks source link

Getting Vercel deployment error for Flutter web app code imported from flutterflow. Carousel_slider dependency is failing. Error: 'CarouselController' is imported from both 'package:carousel_slider/carousel_controller.dart' and 'package:flutter/src/material/carousel.dart'. #3116

Closed dhirajbajaj closed 4 months ago

dhirajbajaj commented 4 months ago

Can we access your project?

Current Behavior

Hi, I am getting an error while deploying a flutter-web app on vercel. I imported the code from flutterflow and while deploying carousal_slider: 4.2.1 is breaking in logs;

The error is : _'CarouselController' is imported from both 'package:carousel_slider/carousel_controller.dart' and 'package:flutter/src/material/carousel.dart'._

The same issue has been posted to carousel slider github repo. https://github.com/serenader2014/flutter_carousel_slider/issues/444

Possible cause: The repo is not maintained anymore and works for flutter sdk: <3 and breaking on flutter sdk version> 3.0.0.

Expected Behavior

It should just deploy.

Steps to Reproduce

Try to deploy any flutter web project imported from flutterflow with carousal_slider:4.2.1 to vercel.

The logs will show the issue as follows:
image

Reproducible from Blank

Bug Report Code (Required)

ITEelsrq+ZROpbxG1s7ub/pvhQMwJEQnarhE0+wbdwshfJDpEIl3Ps78SxJLYtTmen9EC1eKq3wJp9bykdjlDMc4FAqsf6E41b5XQQvdcFOhRLqJC8yKYHdRHp5PfG6Y0KTYvyZvPtFpSiUn3DuEOfCdG3qCf9qOYwx5e6fDbOY=

Visual documentation

Pubspec dependecy:

image

Error log in Vercel:

Screenshot 2024-06-13 15 16 53

Environment

- FlutterFlow version: 
environment:
  sdk: ">=3.0.0 <4.0.0"

dependencies:
  flutter:
    sdk: flutter

- Platform:Web
- Browser name and version: NA, Chrome
- Operating system and version affected: NA

Additional Information

environment: sdk: ">=3.0.0 <4.0.0"

dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter

rzambroni commented 4 months ago

Hi @dhirajbajaj, as you mentioned, it appears to be an error on the package being used under the hood. Not really something we fix. I saw someone posted a workaround on the original issue, hope that helps.

dhirajbajaj commented 4 months ago

Hey @rzambroni Yes i have fixed it by changing the code as mentioned and deployment has worked.

But, i am concerned that when i have to deploy the code again, I will have to redo all the changes again. The issue is the code-generator of flutterflow is using an old version carousel_slider package which is breaking with new flutter versions (>3.0) as its no longer maintained. The fix is to use another package and make code changes.

  # carousel_slider: 4.2.1
  carousel_slider_plus: ^6.0.0
HamidKhanmohammadi commented 3 months ago

I followed @dhirajbajaj path and my problem was solved. thanks for @dhirajbajaj