I am in the process of migrating an application to Angular 6 from Angular 5. at this point I believe I have most issues sorted out and when building with ng serve or ng build main it builds as expected. however when building as ng build --prod main I get the below error
ERROR in : Error: Illegal State: literal maps should have been converted into functions
at _AstToIrVisitor.visitLiteralMap (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:15824:19)
at LiteralMap.visit (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:3483:28)
at ASTWithSource.visit (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:3598:29)
at convertPropertyBinding (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:15626:52)
at createHostBindingsFunction (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:20068:39)
at baseDirectiveFields (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:19754:43)
at compileComponentFromMetadata (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:19793:29)
at compileComponentFromRender2 (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:19878:19)
at /workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:21551:21
at Array.forEach (<anonymous>)
at AotCompiler._compilePartialModule (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:21527:24)
at /workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:21509:58
at Array.forEach (<anonymous>)
at AotCompiler.emitAllPartialModules (/workspace/tarnished-lamp/node_modules/#angular/compiler/bundles/compiler.umd.js:21509:19)
at AngularCompilerProgram._emitRender3 (/workspace/tarnished-lamp/node_modules/#angular/compiler-cli/src/transformers/program.js:252:41)
at AngularCompilerProgram.emit (/workspace/tarnished-lamp/node_modules/#angular/compiler-cli/src/transformers/program.js:235:59)
I have two questions from this
What does this Error actually mean
How do I find it and correct it
Migrating from angular 6.0 to 7.0, I enabled ivy compiler and I got the same error.
Disabling ivy option, AOT build works again.
Related
I'm trying to use Material Custom Component and also using some other components. But I have version conflict Uncaught DOMException.
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "mwc-icon" has already been used with this registry.
Currently, I'm using the yarn package manager to handle custom-component versions.
Somewhere in your code, you're trying to register the same custom element more than once. Maybe you're importing a library twice?
I'm building a package tested for CUDA 9,10 from source, trying to compile it for CUDA11.
I've already changed gencode=arch=compute_70 (was set on 30), and added
target_link_libraries(tsnecuda ${CUDA_cusparse_LIBRARY})
Unfortunately, I still get
tsne-cuda/src/util/math_utils.cu(153): error: identifier "cusparseScsr2csc" is undefined
tsne-cuda/src/util/math_utils.cu(165): error: identifier "cusparseXcsrgeamNnz" is undefined
tsne-cuda/src/util/math_utils.cu(195): error: identifier "cusparseScsrgeam" is undefined
3 errors detected in the compilation of "tsne-cuda/src/util/math_utils.cu".
CMake Error at tsnecuda_generated_math_utils.cu.o.cmake:276 (message):
Error generating file
tsne-cuda/build/CMakeFiles/tsnecuda.dir/src/util/./tsnecuda_generated_math_utils.cu.o
Is there a chance the build process somehow ignores my target_link_libraries? Should I add something else?
Undefined identifier is a compilation issue, not a linking issue.
At least part of the problem here is that CUDA deprecated and removed some functionality from cusparse, including cusparse<t>csr2csc(). The code would need to be rewritten to compile correctly under the latest versions of CUDA 11.x.
For example, for csr2csc, the call to cusparseScsr2csc might be refactored to use this function instead.
One example of deprecation/removal notice for cusparse<t>csr2csc is given here.
I am getting the following error after adding dynamic imports (required for the use case) when trying to build using polymer tools:
info: Clearing build/ directory...
error: Promise rejection: Error: Failed to bundle. Rollup generated 2 chunks or assets. Expected 1.
error: Error: Failed to bundle. Rollup generated 2 chunks or assets. Expected 1.
at Es6Rewriter.<anonymous> (/home/suared/localdev/nodespace/ui/node_modules/polymer-cli/node_modules/polymer-bundler/lib/es6-rewriter.js:138:23)
at Generator.next (<anonymous>)
at fulfilled (/home/suared/localdev/nodespace/ui/node_modules/polymer-cli/node_modules/polymer-bundler/lib/es6-rewriter.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
I found a potential solution in the Rollup docs and the web that referenced this problem being fixed when passing --inlineDynamicImports to the Rollup command. I have not found away to pass this as part of the build process, however. I tried this:
polymer build --auto-base-path --inlineDynamicImport
It reported the error that it is an unknown option. I also tried placing this in the polymer.json as part of the bundle config, unsuccessfully; it doesn't look like it is actually passed to Rollup:
"bundle": {
"inlineCss": true,
"inlineScripts": true,
"rewriteUrlsInTemplates": true,
"sourcemaps": true,
"stripComments": true,
"--inlineDynamicImport": true
}
What is the correct way to pass to the Polymer build tools the --inlineDynamicImport option so that I only get one file and therefore will avoid the "2 chunks" error?
If it helps others till I get a real answer, this workaround worked for me:
Local monkey patch/ update of the following file:
node_modules/polymer-cli/node_modules/polymer-bundler/lib/es6-rewriter.js:74
In the call that reads like the first line, manually add the configuration, leave the rest of the config as-is:
const rollupBundle = yield rollup_1.rollup({
input,
external,
onwarn: (warning) => { },
treeshake: this.bundler.treeshake,
inlineDynamicImports: true, ....(rest of existing command
Any assistance on the right way using the build tools is welcome/ appreciated.
Thanks!
David
After a successful upgrade of a library from Angular 8 to Angular 9
when I try to build it I get the following error:
Compiling TypeScript sources through ngc
ERROR: Decorator argument must resolve to a string
An unhandled exception occurred: Decorator argument must resolve to a string
any lead on what can cause this error or what does it mean?
The issues happened because some of the components Output property had a name which was an Enum and not a plain string. once I changed all those places to a string, it solved the issue.
I use JRuby with jxBrowser. I´ve just upgraded to version 6.8 and my application stopped working. I think the problem comes with the new #JSAccessible annotation. JRuby does not allow method annotation and I inject a JRuby class into a javascript. What used to work now gives me the following message:
Unhandled Java exception: com.teamdev.jxbrowser.chromium.JSFunctionException: Uncaught TypeError: Cannot read property 'set_this' of undefined
Is it possible to not require the #JSAccessible annotation and bring back the functioning of version 6.7?
To bring back functionality of version 6.7 you just need to avoid using the #JSAccessible annotation in your code. This annotation represents an extension to the current API. If you don't use this annotation, the behavior is the same as in previous versions.