I'm a newbie. I create an angular application using the IDEA template and insert the code from the example:
<p *ngIf="true">
Expression is true and ngIf is true.
This paragraph is in the DOM.
</p>
An error occurs:
[INFO]
------------------------------------------------------------------------ [INFO] Starting Build [INFO] Updating asset graph completed, took 16ms
[SEVERE] angular on lib/app_component.dart: Template parse errors:
line 6, column 4 of AppComponent: ParseErrorLevel.FATAL: Can't bind to
'ngIf' since it isn't an input of any bound directive. Please check
that the spelling is correct, and that the intended directive is
included in the host component's list of directives.
^^^^^^^^^^^^ [INFO] Running build completed, took 650ms [INFO] Caching
finalized dependency graph completed, took 853ms [SEVERE]
build_web_compilers|entrypoint on web/main.dart (cached): Unable to
find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a
dev_dependency needs to move to a real dependency), or a build failure
(if importing a generated file).
Please check the following imports:
import 'package:untitled1/app_component.template.dart' as ng; from
untitled1|web/main.dart at 2:1
[SEVERE] build_web_compilers|entrypoint on test/app_test.dart
(cached): Unable to find modules for some sources, this is usually the
result of either a bad import, a missing dependency in a package (or
possibly a dev_dependency needs to move to a real dependency), or a
build failure (if importing a generated file).
Please check the following imports:
import 'package:untitled1/app_component.template.dart' as ng; from
untitled1|test/app_test.dart at 5:1
[SEVERE] build_web_compilers|entrypoint on
test/app_test.dart.browser_test.dart (cached): Unable to find modules
for some sources, this is usually the result of either a bad import, a
missing dependency in a package (or possibly a dev_dependency needs to
move to a real dependency), or a build failure (if importing a
generated file).
Please check the following imports:
import 'package:untitled1/app_component.template.dart' as ng; from
untitled1|test/app_test.dart at 5:1
[SEVERE] Failed after 1.6s
How to fix?
You need to list directives you use in the template in the #Component() annotation
import 'package:angular/angular.dart'
...
#Component(
selector: 'foo-bar',
templateUrl: 'foo_bar.html',
directives: [coreDirectives /* or NgIf */],
)
Related
I reinstalled between jdk-8 and jdk-12, the building process shows different errors but both failed. And both are showing in the log that the bcel package is missing as the first error.
I've set JAVA_HOME in both jdk with the corresponding value;
sh build.sh -Ddist.dir=~/tmp/ant dist
this is the code I get from the org document for building.
Loading source files for package org.apache.tools.tar...
Loading source files for package org.apache.tools.zip...
Constructing Javadoc information...
/home/uppdev/tmp/ant/src/main/org/apache/tools/ant/filters/util/JavaClassHelper.java:23: error: package org.apache.bcel.classfile does not exist
import org.apache.bcel.classfile.ClassParser;
^
/home/uppdev/tmp/ant/src/main/org/apache/tools/ant/filters/util/JavaClassHelper.java:24: error: package org.apache.bcel.classfile does not exist
import org.apache.bcel.classfile.ConstantValue;
:
:
:
Building index for all the packages and classes...
Building index for all classes...
Generating /home/uppdev/tmp/ant/build/javadocs/help-doc.html...
Note: Custom tags that could override future standard tags: #todo. To avoid potential overrides, use at least one period character (.) in custom tag names.
26 errors
100 warnings
BUILD FAILED
/home/uppdev/tmp/ant/build.xml:1012: The following error occurred while executing this line:
/home/uppdev/tmp/ant/build.xml:1520: Javadoc returned 1
Total time: 20 seconds
If this is for ant 1.10.2 then I can provide info:
JDK8 returns an error for missing references in javadocs (see https://bugs.openjdk.java.net/browse/JDK-8224266) which can be maded non-fatal by passing -Xdoclint:none to javadoc.
ant 1.10.2 removed this flag together with the configure param withDoclint which made builds fail if the optional dependencies were not found.
A workaround is to add additionalparam="-Xdoclint:none" to the <javadoc ...> tag in the <target name="javadocs" in build.xml before building.
Fixed part of 1.10.2:
<target name="javadocs" depends="check-javadoc"
description="--> creates the API documentation" unless="javadoc.notrequired">
<mkdir dir="${build.javadocs}"/>
<javadoc additionalparam="-Xdoclint:none"
useexternalfile="yes"
destdir="${build.javadocs}"
failonerror="true"
author="true"
version="true"
locale="en"
windowtitle="${Name} API"
doctitle="${Name}"
maxmemory="1000M"
verbose="${javadoc.verbose}">
I want to create a Builder that would create Env class on the fly. That class should be available for import anywhere in my project. It is as container for environment constants defined in build.yml
Builder itself works fine, it generates desired output, however when I run
pub run build_runner build
build fails with following message
[SEVERE] build_web_compilers:entrypoint on web/main.dart: Unable to
find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a
dev_dependency needs to move to a real dependency), or a build failure
(if importing a generated file).
Please check the following imports:
import
'../.dart_tool/build/generated/buildertest/lib/environment.g.dart';
from buildertest|web/main.dart at 2:1
[INFO] Running build completed, took 4.1s [INFO] Caching finalized
dependency graph completed, took 450ms [SEVERE] Failed after 4.6s
import by itself is ok, as it works fine when I run following snippet
import '../.dart_tool/build/generated/buildertest/lib/environment.g.dart';
void main() {
print("Name:${Environment.name}");
print("Endpoint:${Environment.endpoint}");
}
with
dart web/main.dart
What should be done to make this import valid??
Here is build.yaml
targets:
$default:
builders:
angular_components|scss_builder:
enabled: True
env|builder:
options:
name: "default"
endpoint: "http://example.org"
enabled: true
builders:
env|builder:
import: "env/EnvBuilder.dart"
builder_factories: ["builderFactory"]
is_optional: false
build_extensions:
"$lib$": ["environment.g.dart"]
auto_apply: root_package
runs_before: ["build_test:test_bootstrap","build_modules:module_library","build_modules:dartdevc","build_web_compilers:ddc","build_modules:vm","build_modules:dart2js","build_web_compilers:entrypoint"]
I'm getting the following error while importing the data from Neo4j.
OrientDb server is not running as per the documentation.
[cloud_user#xxxxxxx bin]$ ./orientdb-neo4j-importer.sh -neo4jlibdir ~/neo4j-community-3.4.7/lib/ -neo4jdbdir ~/backup_files/graph.db/
Neo4j to OrientDB Importer v.3.0.10 - Veloce (build eac0654847df662ca03b45a6a5efa5eadd229ca5, branch 3.0.x) - Copyrights (c) 2017 OrientDB LTD
WARNING: 'o' option not found. Defaulting to 'false'.
WARNING: 'i' option not found. Defaulting to 'false'.
WARNING: 'odbdir' option not found. Defaulting to '/opt/orientdb/databases/neo4j_import'.
Please make sure that there are no running servers on:
'/home/cloud_user/backup_files/graph.db' (Neo4j)
and:
'/opt/orientdb/databases/neo4j_import' (OrientDB)
Initializing Neo4j...Done
Initializing OrientDB...Exception in thread "main" java.lang.NoClassDefFoundError: com/tinkerpop/blueprints/impls/orient/OrientGraphFactory
at com.orientechnologies.orient.neo4jimporter.ONeo4jImporterInitializer.invoke(ONeo4jImporterInitializer.java:94)
at com.orientechnologies.orient.neo4jimporter.ONeo4jImporter.execute(ONeo4jImporter.java:108)
at com.orientechnologies.orient.neo4jimporter.ONeo4jImporterMain.main(ONeo4jImporterMain.java:25)
Caused by: java.lang.ClassNotFoundException: com.tinkerpop.blueprints.impls.orient.OrientGraphFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
[cloud_user#xxxxxxx bin]$
I struggled for more than 2 hours trying to import data from Neo4j to Orientdb. The documentation is quite sloppy.
You can solve this issue by downloading the jar- orientdb-graphdb-*.jar into lib folder. However, you still might face the other issues of missing classes.
Downloading jars below helped to resolve such issues:
blueprints-core-*.jar
gremlin-groovy-3.3.4.jar
Let me know if you still face class missing issues.
Hope that saves someone's time.
OrientDB does not contain all of the necessary libraries it needs to perform this task by default. Often, you can define submodules to be imported in a pom file, but if you aren't using a Java application, then you need to import these libraries yourself into the lib/ folder of your OrientDB home directory.
To get the importer to work download the following JAR files and move them into the lib/ folder:
- orientdb-graphdb
- Tinkerpop Blueprints Core
- Gremlin Groovy
I am trying to build my WebGL dart application with "pub build".
I am able to run "pub serve" without problems, but "pub build" gives me 2 erros:
Directive not allowed here
part of MyProject
^^^^^^^^^^^^^^^^
Could not find main [I think this happends because of unfinished compile]
I only use browser:any as dependency.
Why could this be?
Thank you very much!
EDIT:
My pubspec.yaml
name: LD29
description: My LD29 game
author: snip
homepage: snip
dependencies:
browser: any
The includes:
library LD29;
import 'dart:html';
import 'dart:async';
import 'dart:math';
import 'dart:typed_data';
import 'dart:web_gl';
part 'Scene.dart';
part 'MainScene.dart';
part 'Entities.dart';
part 'Quadgrid.dart';
part 'Vecd.dart';
part 'Quad.dart';
part 'TexQuad.dart';
part 'ShaderProgram.dart';
part 'ShaderSource.dart';
part 'TextureGL.dart';
part 'FontRendering.dart';
The problematic "part of"
part of LD29;
class Quadgrid {
const static int size = 20;
const MAX_GRID_W = DISPLAY_WIDTH / size;
const MAX_GRID_H = DISPLAY_HEIGHT / size;
...
}
It seems no diffrent from my other files.
OK, after coming back to it a few months later, I gave debugging this problem another go. For my application, we moved the main() method to a different file than the one that had the 'library coUclient' command at the top. This meant that 'pub build' would fail:
master#dellaptop ~/Dropbox/Dart/coUclient $ pub build
Loading source assets...
Building coUclient...
[Info from Dart2JS]:
Compiling coUclient|web/dart/engine/initialize.dart...
[Error from Dart2JS]:
web/dart/engine/initialize.dart:1:1:
Directive not allowed here.
part of coUclient;
^^^^^^^^^^^^^^^^^^
[Warning from Dart2JS]:
web/dart/engine/initialize.dart:11:5:
Cannot resolve 'localStorage'.
if(localStorage["interface"] == null || localStorage["interface"] == "desktop")
^^^^^^^^^^^^
I don't know why I didn't see it before, but what tipped me off was that I saw it was starting the compile with initalize.dart and it occurred to me that that was the file that had main() in it. I then moved the main() method back into main.dart (which has the 'library coUclient' command at the top) and re-ran pub build. This time it succeeded because it started:
Loading source assets...
Building coUclient...
[Info from Dart2JS]:
Compiling coUclient|web/main.dart...
[Dart2JS on coUclient|web/main.dart]:
and all went well.
Moral of the story is, make sure your main() is in the same file as your 'library ' command and the "Directive not allowed here" problem shouldn't happen.
I'm boldly stepping into the world of AngularDart, admittedly not knowing too much Dart itself yet. I'm creating a new application that does nothing (yet), except includes the latest 'angular' package.
I'm using Dart 1.2.0 and AngularDart 0.9.9.
Very simple pubspec:
name: myapp
dependencies:
angular: any
My app layout:
pubspec.yaml
pubspec.lock
\lib
\packages
\web
In web I have a simple myapp.dart:
import 'package:angular/angular.dart';
main() {
}
My build seems to work fine, but I get the following warning:
Dart: Build
[Warning from Dart2JS on myapp|web/myapp.dart]:
packages\angular\angular.dart:31:23: Hint: Can't find 'animate' in the library 'angular'.
Is 'animate' spelled right?
#MirrorsUsed(targets: const [
^^^^^^^^
My question is, what does this mean, and is this anything to be concerned about?
This was a bug in AngularDart 0.9.9 and is fixed in current versions.