Skip to content
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.

*** Uncaught error Bad state: No element #908

Open
syedsohanahmed opened this issue Nov 3, 2020 · 15 comments
Open

*** Uncaught error Bad state: No element #908

syedsohanahmed opened this issue Nov 3, 2020 · 15 comments

Comments

@syedsohanahmed
Copy link

I am facing this issue to create a aqueduct project
aqd

-- Aqueduct CLI Version: 3.3.0+1
*** Uncaught error
Bad state: No element
**** Stacktrace


@jayjah
Copy link

jayjah commented Nov 3, 2020

@syedsohanahmed
Which dart version do you use?

@Prn-Ice
Copy link

Prn-Ice commented Nov 4, 2020

I have the same error, using Dart SDK version: 2.10.2 (stable) (Tue Oct 13 15:50:27 2020 +0200) on "linux_x64"

@syedsohanahmed
Copy link
Author

@jayjah
I am using Dart SDK version: 2.10.2 (stable) (Tue Oct 13 15:50:27 2020 +0200) on "windows_x64"

@jayjah
Copy link

jayjah commented Nov 4, 2020

Actually I am on "macosx" and aqueduct with 3.3.0+1 and pre-release version is working fine. Do you experience the same behaviour with the pre-release version?

pub global activate aqueduct 4.0.0-b1

The actual problem is the following: Aqueduct tries to get a reference of the global aqueduct package, which was installed with the above command. Obviously it can't find that one and throws an error. It seems that somehow your environment variables are misleading.
The package that makes the mistake is this one: Pub_Cache and moreover this issue seems to be related to your problem as well: Pub_Cache Issue.

You could debug your global dart packages with the Pub_Cache package and I guess you'll find the problem anywhere there.

@syedsohanahmed
Copy link
Author

syedsohanahmed commented Nov 4, 2020

@jayjah
Thanks a lot, the problem has been solved to use the command pub global activate aqueduct 4.0.0-b1
@Prn-Ice

@jayjah
Copy link

jayjah commented Nov 4, 2020

@syedsohanahmed Glad to hear! Cheers up!

@arcticfox1919
Copy link


pub global activate aqueduct 4.0.0-b1 seems useless

@jayjah
Copy link

jayjah commented Nov 5, 2020

@arcticfox1919

Please check my previous post.

The actual problem is the following: Aqueduct tries to get a reference of the global aqueduct package, which was installed with the above command. Obviously it can't find that one and throws an error. It seems that somehow your environment variables are misleading.
The package that makes the mistake is this one: Pub_Cache and moreover this issue seems to be related to your problem as well: Pub_Cache Issue.

You could debug your global dart packages with the Pub_Cache package and I guess you'll find the problem anywhere there.

@arcticfox1919
Copy link

@jayjah
Thanks for your reply, I have solved the problem.It is indeed a problem with Pub_Cache

Need to configure a global environment variable on the windows platform:

PUB_CACHE=%LOCALAPPDATA%\Pub\Cache

@mohahmhas
Copy link

after writing this command
pub global activate aqueduct 4.0.0-b1
Appeared this issue
2121

@MouhibAgrebi
Copy link

after writing this command
pub global activate aqueduct 4.0.0-b1
Appeared this issue
2121

Same any solution ?

@bumpsoo
Copy link

bumpsoo commented Mar 7, 2021

@MouhibAgrebi

Have you added PUB_CACHE to environment variables?
Since I added it, It works fine.

PUB_CACHE
C:\src\flutter.pub-cache
(I use flutter)
If you dont use flutter and installed dart sdk, check user's appdata folder. There should be pub and cache folder.
ensure restart your system if you added it to user variables.

@MouhibAgrebi
Copy link

MouhibAgrebi commented Mar 7, 2021

@MouhibAgrebi

Have you added PUB_CACHE to environment variables?
Since I added it, It works fine.

PUB_CACHE
C:\src\flutter.pub-cache
(I use flutter)
If you dont use flutter and installed dart sdk, check user's appdata folder. There should be pub and cache folder.
ensure restart your system if you added it to user variables.
@bumpsoo063
no, how i can add it ?

@MouhibAgrebi
Copy link

@MouhibAgrebi

Have you added PUB_CACHE to environment variables?
Since I added it, It works fine.

PUB_CACHE
C:\src\flutter.pub-cache
(I use flutter)
If you dont use flutter and installed dart sdk, check user's appdata folder. There should be pub and cache folder.
ensure restart your system if you added it to user variables.

1

@bumpsoo
Copy link

bumpsoo commented Mar 7, 2021

@MouhibAgrebi
oh sorry I misunderstood your comments.
Have your activated stable aqueduct? not the one pre-release(4.0.0-b1).
Was there the same error when activating? or did you get an error when creating a aqueduct project?
If you had no problems with activating stable version and had a problem when creating it. The way in my comment should solve.
And to set environment variables. press window in your keyboard and search environment variable. you can find details by searching.

Anyway I got the error you're getting when I was activating angel-dart. Probably Its because There is not lib/analyzer.dart in newer analyzer package.

you can reference this guy's issue solution

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants