I relied on mythz answer to Add JSON serializer to every model class? to make a very simple object usable with JSON and it worked fine when I ran it. But then I realized that I don't even need that object and removed all of the code I added, including the import of dart:mirrors.
Then I tried to run my Dart webapp again, and even though the main page appeared instantly, the ChromeDevEditor kept showing that "Building main.dart". This is as usual but this time it took waay longer so I tried to click something that should call a function. Didn't work.
I closed both chrome and ChromeDevEditor and restarted it again. Now it doesn't show anything down there.
And the webapp still didn't work, so I opened the folder in windows explorer, Shift+Right-Clicked to open the CMD in that directory and ran pub build
. Because that only caused an Error (That I will insert after this paragraph) I tried running pub get
followed by another pub build
. Didn't help at all.
Here the output of a non-verbose pub build:
F:\Files\Programmieren\Dart\ChromeIDE\MyNewDartTry>pub build > nonverboseerror.t
xt
Build error:
Transform ScriptInlining on MyNewDartTry|web/index.html threw error: Could not f
ind asset browser|lib/dart.js.
null
null
[Error from Dart2JS on MyNewDartTry|web/main.dart]:
packages\route_hierarchical\client.dart:11:8:
Can't read 'package:logging/logging.dart' (Could not find asset logging|lib/logg
ing.dart.).
import 'package:logging/logging.dart';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Dart2JS on MyNewDartTry|web/main.dart]:
1 warning(s) suppressed in package:route_hierarchical.
Build failed.
But I did not mess with the packages... A google search showed me this link that looks somewhat similar to my error message. Maybe the answer has to do with that link, maybe not. But on that link, the following was said by alan-knight:
This looks like the mirror system creation isn't given the package-root. You need two, one for the VM so it knows where the packages are, and one that is used in the code when creating the mirror system.
I wonder what that means for me, because I am not using that mirror-thing-code any longer and I did not make other changes between adding and removing that code. Maybe I shouldn't have copy-pasted code that I did not understand thoroughly...
Any Ideas?
EDIT The package logging/logging.dart is not specified in my dependencies in pubspec.yaml but adding it and running pub get did not help. Pub said "Got dependencies!" and that was it. The package is probably required my route_hierarchical and therefore already in pubs list to get.
pub cache repair
said it reactivated 1 package and fixed the problem. thank you very much Günter Zöchbauer :) would you mind formulating this as an answer?