-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watchdog is not defined in prod build #194
Comments
Hi @martajedrecka, Thanks for the issue, I'll try to reproduce it soon. |
hello, when can we expect some feedback about that issue? We were looking for some production ready solution and we don't have much time for waiting. It's a pity that everything what was implemented locally and what works like a charm will have to go to trash |
Hi, sorry for the lack of response. I've just run an app with Maybe you have something specified differently? I'll post a configuration with which I'm testing this component.
That's unfortunately pretty common for frameworks like Angular where the dev and prod environments diff much :/ That import where the app breaks is internal - the Edit: I'm testing in this repo: https://github.com/ma2ciek/ckeditor5-angular-test. |
Have the same issue here. The issue goes away if you install and import the module from ng2-ckeditor. This I obviously not ideal or even a workable solution in most cases but it might give some insight into the problem |
Hi! Is it possible for you to create a repository with steps to reproduce the error? I tried it once but I failed to reproduce it. Also, could you share your |
Hi @pmacn, can you explain a bit more what you mean by "import the module from ng2-ckeditor"? Where exactly do you import the module? Thanks! |
I have the exact same issue, except that I'm able to build without --prod ( |
@jbgtmartin, could you share your TS / Angular configuration? You can pin an older version (https://github.com/ckeditor/ckeditor5-angular/releases/tag/v1.1.2) that doesn't import the I guess that this has to be somehow connected with a different TS resolution system. |
Hi, thanks for your answer! As expected, it's working fine with v1.1.2. Here is my config: package.json{
...
"dependencies": {
"@angular/animations": "^8.0.0",
"@angular/cdk": "^8.2.3",
"@angular/common": "~8.0.0",
"@angular/compiler": "~8.0.0",
"@angular/core": "~8.0.0",
"@angular/flex-layout": "^8.0.0-beta.27",
"@angular/forms": "~8.0.0",
"@angular/material": "^8.2.3",
"@angular/platform-browser": "~8.0.0",
"@angular/platform-browser-dynamic": "~8.0.0",
"@angular/router": "~8.0.0",
"@ckeditor/ckeditor5-angular": "^1.2.3",
"@ckeditor/ckeditor5-build-classic": "...", // Our custom build, that does not depend on ckeditor5-angular
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.800.0",
"@angular/cli": "~8.0.0",
"@angular/compiler-cli": "~8.0.0",
...
"ts-node": "~7.0.0",
"typescript": "~3.4.3"
}
} tsconfig.json{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5", // I had es2015 previously - same error
"allowSyntheticDefaultImports": true,
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}
} angular.json{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"v1": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/v1",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"preserveSymlinks": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/assets/styles/globals.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"src/assets/styles"
]
},
"scripts": [
"node_modules/phaser-ce/build/custom/pixi.js",
"node_modules/phaser-ce/build/custom/p2.js",
"node_modules/phaser-ce/build/custom/phaser-split.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": {
"scripts": true,
"styles": true,
"hidden": true
},
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "5mb",
"maximumError": "10mb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "v1:build"
},
"configurations": {
"production": {
"browserTarget": "v1:build:production"
},
"dev-server": {
"browserTarget": "v1:build:dev-server"
}
}
},
...
}
}}
} |
Thanks! I'll try to investigate it soon. My blind guess is the |
Hi @ma2ciek, I could reproduce this issue.. by changing the "sourceMap" in production configuration to this: and run 'ng build --prod Tested in this repo: https://github.com/ma2ciek/ckeditor5-angular-test |
Thanks, @Kashspike! I was able to reproduce the issue and it seems that updating all dependencies together with the For those on the lower versions, I can only suggest to turn off all source maps on production. |
Other: Bumped up all internals to match the Angular@10 ecosystem. Bumped up peer dependencies and dependencies of the library - to Angular>=9. Building an Angular app with the `ckeditor5-angular` library on production with sourcemaps turned on will no longer throw errors. Closes #182. Closes #194. BREAKING CHANGE: Angular<9 will not work with the new `ckeditor5-angular` library anymore (it's mostly connected with an update of TypeScript to version TS 4.0, which produces declaration files incompatible with the previous TypeScript versions used by older versions of Angular).
The recently released https://www.npmjs.com/package/@ckeditor/ckeditor5-angular/v/2.0.1 should fix this issue for Angular 9.1+. |
Was having the same issue for Angular 7, was using ckeditor-angular 2.1.0, ckeditor- classic-27.1.0, - downgraded to the respective versions before they introduced watchdog dependency, ckeditor-angular 1.1.0, ckeditor-classic 27.0.0 |
There is an error: Watchdog is not defined when the app is build (both build with --prod flag and without). The problem doesn't exists on local (
ng serve
)I've added package for watchdog, but in my code I'm not using Watchdog. Simple reconstruction of the example provided in docs is implemented: that is editor with onChange function.
The text was updated successfully, but these errors were encountered: