GetStream / stream-chat-angular

💬 Angular Chat SDK ➜ Stream Chat. Build a chat app with ease.
https://getstream.io/chat/sdk/angular/
53 stars 32 forks source link

Error: Cannot resolve type entity i4.MentionModule to symbol #625

Closed JayAhn2 closed 3 months ago

JayAhn2 commented 3 months ago

Hi,

I'm trying to follow the tutorial with my nx monorepo project, but the below error occurs on start.

Could you let me know what's the potential problem?

Many thanks.

 [ERROR] Angular compilation initialization failed. [plugin angular-compiler]

  Error: Cannot resolve type entity i4.MentionModule to symbol
      at reflectTypeEntityToDeclaration (file:///Users/jahn/Project/sprint-client/node_modules/@angular/compiler-cli/bundles/chunk-AOEZR223.js:743:11)
      at extraReferenceFromTypeQuery (file:///Users/jahn/Project/sprint-client/node_modules/@angular/compiler-cli/bundles/chunk-E7DMD7OM.js:1538:26)
      at file:///Users/jahn/Project/sprint-client/node_modules/@angular/compiler-cli/bundles/chunk-E7DMD7OM.js:1533:12
      at Array.map (<anonymous>)
      at extractReferencesFromType (file:///Users/jahn/Project/sprint-client/node_modules/@angular/compiler-cli/bundles/chunk-E7DMD7OM.js:1529:23)
      at DtsMetadataReader.getNgModuleMetadata (file:///Users/jahn/Project/sprint-client/node_modules/@angular/compiler-cli/bundles/chunk-E7DMD7OM.js:1739:16)
      at CompoundMetadataReader.getNgModuleMetadata (file:///Users/jahn/Project/sprint-client/node_modules/@angular/compiler-cli/bundles/chunk-E7DMD7OM.js:1687:27)
      at StandaloneComponentScopeReader.getScopeForComponent (file:///Users/jahn/Project/sprint-client/node_modules/@angular/compiler-cli/bundles/chunk-NJYMXRLX.js:2403:48)
      at CompoundComponentScopeReader.getScopeForComponent (file:///Users/jahn/Project/sprint-client/node_modules/@angular/compiler-cli/bundles/chunk-E7DMD7OM.js:3936:27)
      at ComponentDecoratorHandler.resolve (file:///Users/jahn/Project/sprint-client/node_modules/@angular/compiler-cli/bundles/chunk-E7DMD7OM.js:13746:36)
szuperaz commented 3 months ago

Hi,

Please provide the following information:

Thank you

JayAhn2 commented 3 months ago

What version of Angular do you use?

18.1.3

What version of Angular CLI/compiler do you use?

Angular: ...

Package Version

@angular-devkit/architect 0.1801.3 (cli-only) @angular-devkit/core 18.1.3 (cli-only) @angular-devkit/schematics 18.1.3 (cli-only) @schematics/angular 18.1.3 (cli-only)

What version of stream-chat-angular is installed in your project?

v5.1.0

What version of angular-mentions is installed in your project?

angular-mentions are not the dependency I need to install according to the tutorial.

szuperaz commented 3 months ago

angular-mentions is a peer dependency of the SDK, but it's not listed in the install command because newer versions of npm (10.2.4 included) automatically will install peer dependencies. I've checked, and if angular-mentions is not installed, the error message you'll get is the same.

I noticed that the tutorial doesn't show Yarn install steps (which doesn't install peer dependencies), so if you're using that, please run: yarn add stream-chat-angular stream-chat ngx-float-ui@beta @ngx-translate/core angular-mentions @floating-ui/dom

Let me know if this doesn't solve the issue.

JayAhn2 commented 3 months ago

@szuperaz Hi.

Yes indeed this issue comes from peer dependency resolution.

I have .npmrc setting legacy-peer-deps=true, so I need to install all the dependencies you've mentioned for yarn although I'm using npm.

npm install stream-chat-angular stream-chat ngx-float-ui@beta @ngx-translate/core angular-mentions @floating-ui/dom

With the verbose installations, the issue has solved :)

However, I believe lib should work with the legacy-peer-deps=true setting without imposing excessive dependency addition to users.

Do you have any plan to fix this issue?

Many thanks.