URI Does not exist Dart Analysis - Still builds and runs - dart

I am using WebStorm 2017.2
(172.3317.70, built on July 14, 2017) And the latest stable release of Dart (1.24.2) and I am receiving errors for almost of my imports (except dart core packages eg. dart:async):
error: Target of URI doesn't exist: 'package:charted/charted.dart'.
I have run pub get within WebStorm, and tried pub upgrade and pub get via command line as well. When this did not work I also tried pub cache repair with no prevail.
The errors seem to only affect Webstorm, the application builds with no problems and all packages work fine when using pub build in terminal. This problem only arose when I upgraded dart and Webstorm.
When I make changes to the project the analysis server has to catch up, and will often change its mind about whether or not the URI error persists.
Since I have made no changes to my pubspec.yaml files or the project itself, and the project still builds fine in cmd line, is this a potential bug?
[UPDATE]: I reverted to the old version of dart sdk, and immediately ran pub get and everything worked. I then reverted back to the latest version making sure to run pub get right away, and it seems to be cooperating.
[UPDATE 2]: Issue is definitely recurring. Very hit or miss, currently still have the errors.

Related

Xcode suddenly can not get Swift package revision: "Couldn't get revision"

I opened a project in Xcode that relies on RxSwift which is included as a Swift package through the builtin Swift package manager.
It worked fine a couple of week ago when I created the project.
Now all of a sudden, when trying to build and run my project, I get an error message about that Swift package:
Couldn’t get revision ‘6.5.0^{commit}’
I tried a clean of the build folder, but would still get the same error.
My internet connection is working fine, so it's not a network issue.
I am also surprised that Xcode would try to get the revision again since no update of the package in question, RxSwift was released between the time building last worked fine and today. So I would assume that whatever is cached locally should still be there and functional.
So far I could not find any other reports about this error message.
Apparently, something was wrong with the package cache.
An update of Xcode or a cleaning tool I run on my Mac which deletes some caches might have confused Xcode's package cache.
In Xcode, click File > Packages -> Reset Package Caches from the menu and then build again.
If that does not do it, first try to restart Xcode and then also try cleaning the build folder as well and try again.
For me deleting the .build directory in the project directory worked but that's more likely what Xcode actually does anyway with Reset Package Caches.

Firebase Unity xCode linking errors

I am having issues trying to make a build from Unity (version 5.5.2f1) with Firebase Auth / Database imported. I am using the newest Firebase SDK of 3.0.0.
The errors I get are as follows:
I believe it has something to do with cocoaPods. The XCode project compiles with a podfile. And the errors I believe are related to missing libraries? But all the required libraries are set to iOS, and are included with the XCode project.
Unsure of what to try next. Thanks in advance to anyone able to help.
When you build and run from within unity, it tries to run the pod installation for the dependencies needed, and patches the xcode project file (not workspace).
If there is an error with this process, you should see it in the console.
Normally pods are meant to be used with the workspace file, but since unity automatically opens the xcode project the plugin tries to make it work.
Try opening the .xcodeproj instead of the workspace.
So I finally figured out my issue. I had a previous build that worked all the way through to my device. So I eventually tried opening that one again, and I ran into the same errors with an older build.
So that got me thinking.. Why would a previous build that used to work fail this time around?
I came to the conclusion that the only things that changed were possibly me updated Unity to 5.5.2f1. So I updated again to the latest release at this time which is 5.5.2p3, and ran through the same steps:
1) Build to iOS
2) Install pods in the target folder
3) Run xc workspace
And it successfully built. So it must of been something on Unity's side. If anyone ever runs into a similar situation, hopefully this will help.
P.S. I also did update to the latest release (at this time) of Unity Firebase SDK of 3.0.1. Not sure if that had anything to do with making a successful build, but wanted to put that information out there.

Dartweb Webstorm, 502 Bad Gateway

While running the Get Started guide for Dart and using WebStorm as per the docs, Dartium window shows "502 Bad Gateway" when trying to run index.html for the first time.
When inspecting the IDE, the Pub Serve console shows an error while trying to run % .../pub serve web --port=<port>:
No pubspec.lock file found, please run "pub get" first
I went into my get_started project folder on the terminal and ran the same pub serve command and got the same error.
I am running WebStorm 2016.3.2 and Dart sdk 1.21.0 on Linux x64.
What is the proper procedure to follow here?
WebStorm IDE has been known to have this bug where it fails to run pub get on a project which will cause failures when trying to run the project.
To verify if this is occurring, go into the IDE and check for a Pub Serve warnings message at the bottom of the window. If you see the errors outlined in the OP, then this solution should work.
The problem without running pub get is that the project dependencies have not been resolved and thus the server cannot start.
In the IDE, check the project root for a file pubspec.yaml. Right click the file and select Pub: Get Dependencies. Check the Messages window to follow for the progress. If it finishes ok, the problem should be corrected.
Alternatively, you could run pub get manually from command line as you would do without an IDE.
[Update] The Dart team has updated the documentation to guide users on this issue: https://kw-webdev-dartlang-1.firebaseapp.com/guides/get-started (Pull request #329)

Deploying Angular Dart component with canvas via shadowRoot: what is missing?

I have an angular dart application with a component using canvas via a shadowroot. This runs fine with Dartium, "run as javascript" and pub serve. However when I run pub build and launch the html file in build/web, the component does not appear. The code is at
https://github.com/siddhartha-gadgil/mathlets
Should I be using some special transformers, or do something different to build as against serve?
I tried your project and it appears to be working fine.
What I have done in the past is run pub build and hit the built file in dartium and that will not work. So you have to hit the build file from chrome proper. So if I load .../mathlets/build/web/mathlets.html in chrome it works fine.
The reason for this is because pub build is the release build, which does not copy any of the dart files. However the index file still has the check if dart is enabled than try to use dart files. Well in dartium dart is enabled but the build doesn't have the dart files. In chrome dart is not enabled so then that 'packages/browser/dart.js' file dynamically writes the mathletes.dart.js to index and launches the app that way.
If you want to work around this and improve performance of the release build at the same time you can use this transformer: http://pub.dartlang.org/packages/dart_to_js_script_rewriter
We are using this also. Ensure it's the last transformer run though, if it's before the angular transformer there are problems.

Cannot find referenced source: package:web_ui/web_ui.dart

I have a project that uses Dart and the web_ui package. I just upgraded Dart to libv2, specifically:
Dart Editor version 0.3.1_r17594
Dart SDK version 0.3.1.3_r17594
I just updated web_ui to 0.3.0+2.
Now, I'm getting these errors:
Cannot find referenced source: package:web_ui/web_ui.dart
no such type "WebComponent"
"ChatWindowComponent" has no method named "dispatch"
When I run my build.dart, it completes successfully, but it doesn't create an out directory. Nor does it give any error messages.
What's going on? Why can't it find package:web_ui/web_ui.dart? I can clearly see that pub has set stuff up correctly.
It's a known issue. See http://code.google.com/p/dart/issues/detail?id=7822. The issue was closed today. I tried out a continuous build of Dart Editor, but that lead to different errors--I'll save that for another question.
When I run my build.dart, it completes successfully, but it doesn't create an out directory. Nor does it give any error messages.
I run the editor with 'automatically run pub' disabled. Creating a new web ui projects yields a few errors, after installing pub the errors are gone, but the timestamps of the files are to old now.
I changed the file that was to build and the out directory appeared immediately.

Resources