pazznetwork / ngx-chat

Angular XMPP Client & Chat UI
Other
33 stars 64 forks source link

ngx-chat won't compile with "enableIvy": true #14

Closed jameskentTX closed 4 years ago

jameskentTX commented 5 years ago

Hello Trumpi! Your app won't compile if you enable ivy by adding enableIvy": true to "angularCompilerOptions" in tsconfig.json file ( https://angular.io/guide/ivy ).

I don't know if is possible to have ivy enabled and still using your app, so please take a look at this problem, if you find free moment.

With ivy enabled there are many, many build errors, like this:

BUILD ERROR
node_modules/@angular/common/common.d.ts(115,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
node_modules/@angular/forms/forms.d.ts(2669,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
node_modules/@angular/common/http/http.d.ts(2799,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
node_modules/@angular/cdk/text-field/typings/text-field-module.d.ts(8,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
projects/pazznetwork/ngx-chat/src/lib/components/chat-room-messages/chat-room-messages.component.ts(15,14): error TS-993001: Unsupported private class ChatRoomMessagesComponent. This class is visible to consumers via NgxChatModule -> ChatRoomMessagesComponent, but is not exported from the top-level library entrypoint.
projects/pazznetwork/ngx-chat/src/lib/components/chat-filedrop/file-drop.component.ts(8,14): error TS-993001: Unsupported private class FileDropComponent. This class is visible to consumers via NgxChatModule -> FileDropComponent, but is not exported from the top-level library entrypoint.
projects/pazznetwork/ngx-chat/src/lib/directives/links.directive.ts(9,14): error TS-993001: Unsupported private class LinksDirective. This class is visible to consumers via NgxChatModule -> LinksDirective, but is not exported from the top-level library entrypoint.

node_modules/@angular/common/common.d.ts(115,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
node_modules/@angular/forms/forms.d.ts(2669,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
node_modules/@angular/common/http/http.d.ts(2799,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
node_modules/@angular/cdk/text-field/typings/text-field-module.d.ts(8,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
projects/pazznetwork/ngx-chat/src/lib/components/chat-room-messages/chat-room-messages.component.ts(15,14): error TS-993001: Unsupported private class ChatRoomMessagesComponent. This class is visible to consumers via NgxChatModule -> ChatRoomMessagesComponent, but is not exported from the top-level library entrypoint.
projects/pazznetwork/ngx-chat/src/lib/components/chat-filedrop/file-drop.component.ts(8,14): error TS-993001: Unsupported private class FileDropComponent. This class is visible to consumers via NgxChatModule -> FileDropComponent, but is not exported from the top-level library entrypoint.
projects/pazznetwork/ngx-chat/src/lib/directives/links.directive.ts(9,14): error TS-993001: Unsupported private class LinksDirective. This class is visible to consumers via NgxChatModule -> LinksDirective, but is not exported from the top-level library entrypoint.

Error: node_modules/@angular/common/common.d.ts(115,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
node_modules/@angular/forms/forms.d.ts(2669,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
node_modules/@angular/common/http/http.d.ts(2799,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
node_modules/@angular/cdk/text-field/typings/text-field-module.d.ts(8,22): error TS-996002: Appears in the NgModule.imports of NgxChatModule, but could not be resolved to an NgModule class
projects/pazznetwork/ngx-chat/src/lib/components/chat-room-messages/chat-room-messages.component.ts(15,14): error TS-993001: Unsupported private class ChatRoomMessagesComponent. This class is visible to consumers via NgxChatModule -> ChatRoomMessagesComponent, but is not exported from the top-level library entrypoint.
projects/pazznetwork/ngx-chat/src/lib/components/chat-filedrop/file-drop.component.ts(8,14): error TS-993001: Unsupported private class FileDropComponent. This class is visible to consumers via NgxChatModule -> FileDropComponent, but is not exported from the top-level library entrypoint.
projects/pazznetwork/ngx-chat/src/lib/directives/links.directive.ts(9,14): error TS-993001: Unsupported private class LinksDirective. This class is visible to consumers via NgxChatModule -> LinksDirective, but is not exported from the top-level library entrypoint.
jameskentTX commented 5 years ago

Hello Trumpi! I have updated my app to run with Ivy enabled. Your app is working too. I've made many many changes, so I don't know yet which are crucial, and which are unnecessary.

Problem was with directories. I used suggestions from: https://dev.to/negue/angular-ivy-overcome-the-first-obstacles-400n

I've made these changes:

I made many changes trying to find solution, but these above are probably crucial and are enough to use your project with Ivy enabled (enableIvy": true in tsconfig.app.json, "aot": true in angular.json).

trampi commented 5 years ago

Hi @jameskentTX,

thank you for reporting this. I will have a look at this to ensure compatibility of ngx-chat with ivy.

PS: It's trampi, not trumpi 😉

trampi commented 4 years ago

With the version 9 release of Angular, the new compiler and runtime instructions are used by default instead of the older compiler and runtime, known as View Engine.

As ngx-chat arrived at 0.9.0 (synchronized with angular version numbers) we're now officially supporting angular 9 / ivy. Feel free to reopen this ticket if any issues arise.