With the latest version of dart (editor 24275) I keep getting an error re: dart:uri
This is placed in my built html:
import "dart:isolate" as FB;import "dart:uri" as MH;import "dart:json" as ............
Dart VM version: 0.5.20.4_r24275 (Fri Jun 21 05:02:35 2013) on "macos_ia32"
dart:uri is now in dart:core I recall.. but my html keeps getting built with this in it and so doesn't run in Chromium with the Dart VM
I've removed the out folder and rebuilt, does not resolve it.
Have you definitely removed all instances of import "dart:uri" from your code, whether they are stand alone Dart scripts or scripts embedded in HTML templates/components etc?
It's always good to run "Reanalyze Sources" too.
It sounds like you need to run pub update.
Related
I have a web listener written in dart. I want to start it quicker, thats how I found https://dart.dev/tools/dart-compile#jit-snapshot.
However, when I execute dart compile jit-snapshot server.dart it runs the code which will run forever and so I never get the server.jit file. When I close the web-listener after a couple seconds it works fine but thats not what i want to compile.
Dart SDK version: 2.19.0-424.0.dev (dev) (Wed Nov 23 07:45:20 2022 -0800) on "linux_arm64"
dart compile jit-snapshot server.dart
should: generate server.jit
does: run forever. When I cancel it with Ctrl+c the .jit file is not generated...
For best performance, use AOT compilation
dart compile aot-snapshot server.dart
or build an executable
dart compile exe server.dart
I'm here to describe a subtle issue about Grails and his import feature supplied by Gradle.
My specs:
OS Ubuntu 16.04 LTS
My Grails version is 3.2.0.M2
Java version is jdk1.8.0_31
And I'm using Intellij 2016
I have created a project (Foo) with a module (Bar)
Bar module exists under Foo main project and has his CallMeController
Running Foo app and calling the url {urlbase}/CallMe will result in a correct controller call
Now I move the Bar folder outside the Foo folder project
I change the settings.gradle file using an includeFlat in place of include directive which should be supported without any problem as reported in the official documentation
Intellij recognize the project structure correctly
Running the application and calling the url {urlbase}/CallMe will result into a 404 Not found
In the files linked below (Working example and Not working example) there are the two simple projects which reproduce the issue.
The working one is related with include directive, the second (not working) one is related with includeFlat directive.
Is this a normal behavior?
Working example
Not working example
I installed dart-sdk and downloaded dart plugin to Phpstorm 8.0.3, but I cant figure out how to transpile dart to js. When I am trying to make file watcher I dont have any Dart2Js predefined template in settings.
Thank you
I know only WebStorm 9 and 10. Maybe you can still derive how it might work in PHPStorm.
Usually you don't want to build to JavaScript on each file change because this would slow your machine down.
During development you use pub serve which is automatically launched by WS 9 and 10 and which transpiles Dart files to JavaScript only on demand (when requested by a browser) and only compiles what it didn't compile previously.
For deployment WebStorm can use the Pub: build ... context menu of the pubspec.yaml file in the project view.
See #Günter Zöchbauer answer.
Using dart2js is not the recommended approach, as it runs on file level instead of project, creates output in the src folder, etc. - but the main reason is that it is not clear when/why to use it. If you need to build your project, use 'pub build' (available in pubspec.yaml right-click menu). When debugging in browser, 'pub serve' is always used implicitly - it performs all needed transformations...
But, if you still need this watcher, you can easily configure it yourself by adding a watcher of 'custom' type.
Program: path/to/dart2js
Arguments: --out=$FilePath$.js $FilePath$
Working directory: $FileDir$
Output paths: $FileName$.js:$FileName$.js.map:$FileName$.js.deps
I launched Dart Editor yesterday but it didn't work giving the error:
("A Java Runtime(jre) or Java Development Kit(jdk) must be avaible in
order to run DartEditor. No Java virtual machine was found after
searching the following loacations:
C:\Users\name\Donwloads\darteditor-windows-x64\dart\jre\bin\javaw.exe
jawaw.exe in your current PATH ")
Do you think how i going to fix this error ?
Thanks
Checkout this link:
https://www.dartlang.org/tools/editor/troubleshoot.html
"Launching Dart Editor"
Your Java version should have the same bit width as your Dart Editor version. For example, if you're using a 64-bit Dart Editor, then you should use 64-bit Java. Otherwise, you might see a message like this when you try to launch Dart Editor:
Failed to load the JNI shared library "C:\Program Files(x86)\Java\jre6\\bin\client\jvm.dll
To determine which version of Java you are running, do one of the following:
1-Go to CMD type java -version.
2-Go to Start -> Programs and Features.
Specifying the Java runtime
If necessary, you can specify the Java runtime that Dart Editor uses. Go to your Dart installation directory and add the following two lines to DartEditor.ini immediately before the existing ‑vmargs line:
-vm
/full/path/to/java
Important: On Windows, use double backslashes (\) as the directory separator:
-vm
c:\\bin\\java_jdk1.7.0\\bin\\javaw.exe
For example, DartEditor.ini might have:
-vm
/usr/local/buildtools/java/jdk-64/bin/java
-vmargs
You just need to download the Java Development SDK and your Java version should have the same bit width as your Dart Editor version. For example, if you're using a 64-bit Dart Editor, then you should use 64-bit Java. Otherwise, you might see a message like this when you try to launch Dart Editor:
You can download it here:
http://www.oracle.com/technetwork/java/javase/downloads/index.html?ssSourceSiteId=otnjp
and specify the java/bin directory in the darteditor.ini file.you can specify the Java SDK that Dart Editor uses. Go to your Dart installation directory and add the following two lines to DartEditor.ini immediately before the existing ‑vmargs line:
-vm
/full/path/to/java
Important: On Windows, use double backslashes () as the directory separator:
-vm
c:\\bin\\java_jdk1.7.0\\bin\\javaw.exe
For example, DartEditor.ini might have:
-vm
/usr/local/buildtools/java/jdk-64/bin/java
-vmargs
If it still doesn't work then you can follow this:
https://www.dartlang.org/tools/editor/troubleshoot.html
I made jre folder in my dart program folder.
And loaded there latest JRE. (Java runtime environment)
It stays in every new darteditor installation.
Better / right way would maybe be using path clause...
I dont know how to.. / dont want to use it.
My choise might need to load new version of jre now and then.
Hope this helps you...
I'm trying to run pub deploy command in my Dart project, but it always ends with this error: "Pub deploy failed, [1] Cannot read link". No more information outputs into console.
I tried to run it in basic Dart browser project (the one with text reversing), but same error occurred again.
Did anyone have same problem? Any ideas how to fix it?
I have the same issue.
In my case, the Dart project is stored in NTFS hard drive (I share it with Windows OS) and Dart deploy (run from Eclipse) runs on Ubuntu.
Simply move the Dart project to Ubuntu hard drive then things come back to normal.
GS
This is probably a problem with the packages symlinks. If you delete them and run pub install it should work again.
According to dart-sdk/lib/io/link.dart:
On the Windows platform, the link will be created as a Junction
On other platforms, the posix symlink() call is used to make a symbolic link
On Linux platforms, storing Dart project in NTFS drive causes Pub to fail. Because posix symlink() is used on NTFS partition and doesn't create a valid NTFS junction point.
The solution is to move the project folder to a partition that uses posix symlinks natively, such as one formatted to ext4.