ngx-quill with Angular Elements
See original GitHub issueI’m building an Angular 13 custom element / web component that uses ngx-quill. Here are the versions for the packages in my package.json:
"ngx-quill": "^16.1.1",
"@angular/elements": "~13.0.2",
"@angular/core": "~13.0.2",
I build the web component app using the command: ng build plots-elements --output-hashing none
. When I navigate to my component in the consuming app I get a blank area where the component is supposed to render and I get the error:
..\..\dist\plots-elements\runtime.js:formatted:194 GET http://localhost:4202/263.js net::ERR_ABORTED 404 (Not Found)
r.l @ ..\..\dist\plots-elements\runtime.js:formatted:194
r.f.j @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
r.e @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
Dm @ ..\..\dist\plots-elements\runtime.js:formatted:194
h @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
ZoneAwarePromise @ zone.js:1387
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
_trySubscribe @ ..\..\dist\plots-elements\runtime.js:formatted:194
subscribe @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
subscribe @ ..\..\dist\plots-elements\runtime.js:formatted:194
ngAfterViewInit @ ..\..\dist\plots-elements\runtime.js:formatted:194
Ig @ ..\..\dist\plots-elements\runtime.js:formatted:194
pg @ ..\..\dist\plots-elements\runtime.js:formatted:194
xa @ ..\..\dist\plots-elements\runtime.js:formatted:194
zo @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
zo @ ..\..\dist\plots-elements\runtime.js:formatted:194
gd @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
zo @ ..\..\dist\plots-elements\runtime.js:formatted:194
gd @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
zo @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
zo @ ..\..\dist\plots-elements\runtime.js:formatted:194
gd @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
zo @ ..\..\dist\plots-elements\runtime.js:formatted:194
gd @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
zo @ ..\..\dist\plots-elements\runtime.js:formatted:194
Mv @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
hd @ ..\..\dist\plots-elements\runtime.js:formatted:194
detectChanges @ ..\..\dist\plots-elements\runtime.js:formatted:194
tick @ ..\..\dist\plots-elements\runtime.js:formatted:194
(anonymous) @ ..\..\dist\plots-elements\runtime.js:formatted:194
invoke @ zone.js:372
onInvoke @ ..\..\dist\plots-elements\runtime.js:formatted:194
invoke @ zone.js:371
run @ zone.js:134
run @ ..\..\dist\plots-elements\runtime.js:formatted:194
next @ ..\..\dist\plots-elements\runtime.js:formatted:194
__tryOrUnsub @ ..\..\dist\plots-elements\runtime.js:formatted:194
next @ ..\..\dist\plots-elements\runtime.js:formatted:194
_next @ ..\..\dist\plots-elements\runtime.js:formatted:194
next @ ..\..\dist\plots-elements\runtime.js:formatted:194
next @ ..\..\dist\plots-elements\runtime.js:formatted:194
emit @ ..\..\dist\plots-elements\runtime.js:formatted:194
dp @ ..\..\dist\plots-elements\runtime.js:formatted:194
ev @ ..\..\dist\plots-elements\runtime.js:formatted:194
onInvokeTask @ ..\..\dist\plots-elements\runtime.js:formatted:194
invokeTask @ zone.js:405
runTask @ zone.js:178
invokeTask @ zone.js:487
invokeTask @ zone.js:1600
globalZoneAwareCallback @ zone.js:1626
Show 32 more frames
2..\..\dist\plots-elements\runtime.js:formatted:194 ERROR ChunkLoadError: Loading chunk 263 failed.
(error: http://localhost:4202/263.js)
at Object.r.f.j (..\..\dist\plots-elements\runtime.js:formatted:194:NaN)
Everything else in my project works. The component works in an Angular app / imported as an Angular library. When it is compiled as an Angular Element and imported into a vanilla js page, it doesn’t work. Is there a way to fix this or is there a work around?
Issue Analytics
- State:
- Created 2 years ago
- Comments:24 (12 by maintainers)
Top Results From Across the Web
Build a rich text editor in Angular with ngx-quill
ngx -quill is an angular module for the Quill Rich Text Editor containing all components you need. Installation. npm install ngx-quill. For ...
Read more >ngx-quill
Angular components for the easy use of the QuillJS richt text editor.. Latest version: 20.0.1, last published: 15 days ago.
Read more >Angular Components For Quill Editor - ngx-quill
ngx -quill is the new angular (>2) implementation of rich text editor Quill. The library makes it simple to insert the Quill rich...
Read more >Top 5 ngx-quill Code Examples
// // LibRoutingModule: https://angular.io/guide/router#routing-module-order ; // import { LibRoutingModule } from './lib-routing.module'; import { ...
Read more >Angular 13 ngx-quill WYSIWYG Editor Example to ... - YouTube
Download the full source code of application ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For any fellow Googlers.
I modified the above code and it seems to work for our Angular 13 project with Angular Elements.
and in the module
I assume because this prevents the code in this if statement from executing:
https://github.com/KillerCodeMonkey/ngx-quill/blob/6a42c119e2a4bb66db158f1cdbc085b9cb801fb4/projects/ngx-quill/src/lib/quill.service.ts#L16
Though this does also bypass the
addEventListener
unpatching.Since there is nothing I can do or change. I would leave it closed.
Did you tried the things mentioned in the comments above? Overwriting the quill service and using quilljs from the window Object instead of importing it?
In general I have never used angular elements. But if you need an alternative to ngx-quill try stencil-quill. It compiles to a native web component and can be used in angular, but without angular form controls/models.