aqueduct icon indicating copy to clipboard operation
aqueduct copied to clipboard

aqueduct create crashes with "Uncaught Error: Bad State "

Open InterFelix opened this issue 4 years ago • 33 comments

I can't get aqueduct create to work. The error message is as follows:

$ aqueduct create scoutventory_backend
-- Aqueduct CLI Version: 3.3.0+1
*** Uncaught error       
    Bad state: No element
  **** Stacktrace
  * #0      ListMixin.firstWhere (dart:collection/list.dart:150:5)
  * #1      CLIAqueductGlobal.aqueductPackageRef (package:aqueduct/src/cli/commands/create.dart:342:10)
  * #2      CLIAqueductGlobal.templateDirectory (package:aqueduct/src/cli/commands/create.dart:347:12)
  * #3      CLIAqueductGlobal.getTemplateLocation (package:aqueduct/src/cli/commands/create.dart:351:12)
  * #4      CLITemplateCreator.handle (package:aqueduct/src/cli/commands/create.dart:51:27)
  * #5      CLICommand.process (package:aqueduct/src/cli/command.dart:159:20)
  * <asynchronous suspension>
  * #6      CLICommand.process (package:aqueduct/src/cli/command.dart:135:12)
  * #7      main (file:///C:/Users/myuser/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/aqueduct-3.3.0+1/bin/aqueduct.dart:9:27)
  * #8      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
  * #9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
  ****

This happens regardless of the project name I enter. Also, a folder for the project is created. However it remains empty and the program crashes.

InterFelix avatar May 08 '20 08:05 InterFelix

Same Herer with the same version, using Windows 10, the same if try to create inside VSCode Extension.

JillyTaboga avatar May 08 '20 16:05 JillyTaboga

What is your PUB_CACHE environment variable?

itsjoeconway avatar May 08 '20 16:05 itsjoeconway

I don't have it set. I'm on windows. So default path would be %APPDATA%\Pub\Cache

InterFelix avatar May 10 '20 21:05 InterFelix

experiencing same thing, also on windows 10

jhigdon avatar May 11 '20 03:05 jhigdon

I'm also experiencing the same issue.

-- Aqueduct CLI Version: 3.3.0+1
*** Uncaught error
    Bad state: No element
  **** Stacktrace
  * #0      ListMixin.firstWhere (dart:collection/list.dart:150:5)
  * #1      CLIAqueductGlobal.aqueductPackageRef (package:aqueduct/src/cli/commands/create.dart:342:10)
  * #2      CLIAqueductGlobal.templateDirectory (package:aqueduct/src/cli/commands/create.dart:347:12)
  * #3      CLITemplateList.handle (package:aqueduct/src/cli/commands/create.dart:298:53)
  * #4      CLICommand.process (package:aqueduct/src/cli/command.dart:159:20)
  * <asynchronous suspension>
  * #5      CLICommand.process (package:aqueduct/src/cli/command.dart:135:12)
  * #6      CLICommand.process (package:aqueduct/src/cli/command.dart:135:12)
  * #7      main (file:///C:/Users/bett/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/aqueduct-3.3.0+1/bin/aqueduct.dart:9:27)
  * #8      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
  * #9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
  ****

bettdouglas avatar May 12 '20 21:05 bettdouglas

Same thing, also on windows 10

elhe26 avatar May 15 '20 16:05 elhe26

I am experiencing the same issue on windows 10

kamaribedwarddev avatar May 16 '20 00:05 kamaribedwarddev

I am experiencing the same issue on windows 10

Hi All, I added the following ENVIRONMENT VARIABLES and added an entry to the PATH variable, then reinstalled Aqueduct and it suddenly started working. Not sure what happened.

NEW VARIABLES image

PATH VARIABLE ENTRIES: image

kamaribedwarddev avatar May 16 '20 11:05 kamaribedwarddev

Any idea? same issue here .. :)

justsasri avatar May 26 '20 14:05 justsasri

Any solve ? I face the same issue .

OmarBakry-eg avatar May 27 '20 01:05 OmarBakry-eg

Any idea? same issue here .. :)

Have you tried what i did?

kamaribedwarddev avatar May 27 '20 01:05 kamaribedwarddev

@kamaribedwarddev this solution did not work for me .

OmarBakry-eg avatar May 27 '20 01:05 OmarBakry-eg

The Solution as @kamaribedwarddev said but it works for me when I changed PUB_HOSTED_URL to https://pub.dev .

Thank You @kamaribedwarddev !

OmarBakry-eg avatar May 27 '20 03:05 OmarBakry-eg

Thank you for your comments and suggestions @kamaribedwarddev @OmarBakry-eg you helped me a lot.

ghost avatar May 28 '20 15:05 ghost

The Solution as @kamaribedwarddev said but it works for me when I changed PUB_HOSTED_URL to https://pub.dev . Thanks @OmarBakry-eg

For Flutter people, set PUB_CACHE to "Flutter_Directory\.pub-cache". In my computer it is C:\flutter\.pub-cache

Logout from your account so that environment variables get updated. After that activate aqueduct again pub global activate aqueduct For Flutter folks: flutter pub global activate aqueduct

bahadurvaibhav avatar May 29 '20 15:05 bahadurvaibhav

You are all welcome ! @bahadurvaibhav , @javierxnora

OmarBakry-eg avatar Jun 02 '20 01:06 OmarBakry-eg

I am experiencing the same issue on windows 10

Hi All, I added the following ENVIRONMENT VARIABLES and added an entry to the PATH variable, then reinstalled Aqueduct and it suddenly started working. Not sure what happened.

NEW VARIABLES image

PATH VARIABLE ENTRIES: image

worked for me! thank you so much!

vjpelissari avatar Jun 18 '20 15:06 vjpelissari

I'm also experiencing the same issue.

-- Aqueduct CLI Version: 3.3.0+1
*** Uncaught error
    Bad state: No element
  **** Stacktrace
  * #0      ListMixin.firstWhere (dart:collection/list.dart:150:5)
  * #1      CLIAqueductGlobal.aqueductPackageRef (package:aqueduct/src/cli/commands/create.dart:342:10)
  * #2      CLIAqueductGlobal.templateDirectory (package:aqueduct/src/cli/commands/create.dart:347:12)
  * #3      CLITemplateList.handle (package:aqueduct/src/cli/commands/create.dart:298:53)
  * #4      CLICommand.process (package:aqueduct/src/cli/command.dart:159:20)
  * <asynchronous suspension>
  * #5      CLICommand.process (package:aqueduct/src/cli/command.dart:135:12)
  * #6      CLICommand.process (package:aqueduct/src/cli/command.dart:135:12)
  * #7      main (file:///C:/Users/bett/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/aqueduct-3.3.0+1/bin/aqueduct.dart:9:27)
  * #8      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
  * #9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
  ****

I too couldn't solve the issue by implementing the above-quoted solutions.. can anybody help?

TechPertz avatar Jun 27 '20 07:06 TechPertz

Make sure you are in a writable directory. The default cmd path on win 10 is "C:\WINDOWS\system32>" Changing directory worked for me (with the above solution)

LovingLightForever avatar Jul 09 '20 12:07 LovingLightForever

I am experiencing the same issue on windows 10

Hi All, I added the following ENVIRONMENT VARIABLES and added an entry to the PATH variable, then reinstalled Aqueduct and it suddenly started working. Not sure what happened.

NEW VARIABLES image

PATH VARIABLE ENTRIES: image

worked for me! thank you so much!

JefTavares avatar Jul 09 '20 15:07 JefTavares

The error still occuring even after tried with above ways

yhhCh405-CS avatar Aug 13 '20 10:08 yhhCh405-CS

@yhhCh405-CS yea, i guess they have stopped the support only.. or maybe the community is really small. Anyways, i started using django(node too) for backend... Firebase is pretty powerful too along with firebase cloud functions... Just lemme know if anybody can find the Solution.

TechPertz avatar Aug 13 '20 11:08 TechPertz

I am experiencing the same issue on windows 10

Hi All, I added the following ENVIRONMENT VARIABLES and added an entry to the PATH variable, then reinstalled Aqueduct and it suddenly started working. Not sure what happened. NEW VARIABLES image PATH VARIABLE ENTRIES: image

worked for me! thank you so much!

Worked for me aswell, thank you!!!

IMPORTANT STEP, REINSTALL AQUEDUCT AFTER THE ENTRIES

The first time i tried, i didn't see that.

romulopuk avatar Sep 29 '20 03:09 romulopuk

Followed those instructions with the environment and pub_cache still get the error.

jefflindholm avatar Oct 02 '20 12:10 jefflindholm

The Solution as @kamaribedwarddev said but it works for me when I changed PUB_HOSTED_URL to https://pub.dev . Thanks @OmarBakry-eg

For Flutter people, set PUB_CACHE to "Flutter_Directory.pub-cache". In my computer it is C:\flutter.pub-cache

Logout from your account so that environment variables get updated. After that activate aqueduct again pub global activate aqueduct For Flutter folks: flutter pub global activate aqueduct

This worked for me, Thank You!

Amitpatil215 avatar Oct 21 '20 19:10 Amitpatil215

i have no pub_cache folder inside pub_dartlang.org folder any help plz

Adnantjexx avatar Oct 27 '20 19:10 Adnantjexx

Does anyone have a solution for this same error but on the Mac system?

TJMusiitwa avatar Oct 28 '20 14:10 TJMusiitwa

Does anyone have a solution for this same error but on the Mac system?

I have the as problem. I using a Mac and I have DART and FLUTTER installed! Any solution for Mac users?

ghost avatar Oct 29 '20 08:10 ghost

" By default, this directory is located under .pub-cache in your home directory (on Mac and Linux), or in %LOCALAPPDATA%\Pub\Cache (on Windows). " - Dart Dev Tools

jayjah avatar Oct 29 '20 09:10 jayjah

11/21/2020 , Same thing, also on windows 10.

hilobekerfulaisien avatar Nov 21 '20 03:11 hilobekerfulaisien