Closed DGolverdingen closed 6 years ago
Can anyone share a code sample that triggers this error? Our attempts at producing one didn't work out.
I'm having the same issue with a client using the Grid component. Would really like to see a fix for this soon, or we will be forced to use another Grid framework, updating Angular is more important for them than sticking with Kendo.
Please, note that you can share a sample project under an NDA in a support ticket. A trimmed-down version would do, as long as it experiences the problem in question.
same issue here
Hi @tsvetomir,
I am having this issue on a larger project which cannot be shared.
In response to your initial post, i tried to create a small project to but was also unable to reproduce the problem.
I tried creating a small project with a lazy loaded module that used the grid (all modules using the grid have this problem)
Do you know which features of the grid require the Animation library? A simple binding the grid to an object did not work.
@thaoula I've created a sample project with the PDF Export module - this is where the drawing is used. I don't get any errors in a production build.
@tsvetomir Hi, my production configuration looks a bit different, maybe it's a combination of the settings. Could you try with the following config:
{
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": true,
"extractCss": true,
"namedChunks": true,
"aot": true,
"extractLicenses": true,
"vendorChunk": true,
"buildOptimizer": true,
"commonChunk": true,
"baseHref": " ",
"statsJson": true,
"forkTypeChecker": true,
"subresourceIntegrity": true,
"verbose": false,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
Do you encounter this problem with buildOptimizer false??
Ah, my bad, i've disabled it to get it to work, sorry. It's should be true ofc. I Have updated the comment to reflect this.
The error appeared after enabling source maps.
@LarsVonQualen can you confirm if "sourceMap": false
clears the error in your project?
After doing the following updates, it seems to work. Even with sourceMaps set to true..
@angular-devkit/build-angular 0.6.3 -> 0.6.5
@angular-devkit/build-optimizer 0.6.3 -> 0.6.5
@angular/cli 6.0.3 -> 6.0.5
May have been a problem with the new cli build system?
@LarsVonQualen I still get the error with the latest versions.
There seems to be some caching involved, as changing "sourceMap" only has an effect if I clean-up "node_modules" and re-install. Otherwise, it stays in the working/non-working initial state.
So i tried to verify your result, and im not sure if it's related to caching, though it could seem like it. This may be related: https://github.com/angular/devkit/issues/937 or https://github.com/angular/devkit/issues/816
"buildOptimizer": true
and "sourceMap": true
-> Produces the error
"buildOptimizer": true
and "sourceMap": false
-> Produces the error
"buildOptimizer": false
and "sourceMap": true
-> Works
Then without cleaning running:
"buildOptimizer": true
and "sourceMap": true
-> Produces the error
@LarsVonQualen thanks for your assistance
The development version of the package should be now free of this problem, try it with:
npm install --save @progress/kendo-drawing@dev
Released officially as @progress/kendo-drawing
v1.5.6
Ok thnx, so the problem is fixed in the build process of kendo-drawing?
Yes, the fix is in kendo-drawing - two imports had side-effects that apparently confused the build optimizer. For example:
@tsvetomir Thank you very much, everything seems to be working after updating the kendo-drawing package.
Thank you :+1:
I'll close this issue, as we managed to work around it in the kendo-drawing package. Hopefully angular/angular-cli#11055 will be resolved so we don't get the same problem elsewhere.
I'm submitting a...
Current behavior
Running a production build (Latest Angular 6 & Kendo packages) with buildOptimizer: true results in: an Uncaught ReferenceError: Animation is not defined.
With buildOptimizer: false there are no problems.
I really don't know how to solve this, anyone any idea?
console output:
This error is found in location: node_modules\@progress\kendo-drawing\dist\es\animations\animation-factory.js
Expected behavior
no uncaught error from any @progress/x package
Minimal reproduction of the problem with instructions
I fail to reproduce this in a small demo project.
Environment
Package versions:
Browser:
System:
tsconfig.json:
tsconfig.app.json: