0

I'm facing the below-mentioned issue while generating production build after using @twilio/Conversations.

ERROR in ../node_modules/twilsock/builds/browser.js
Module build failed (from ../node_modules/@angular-devkit/build-angular/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
TypeError: Cannot read property 'flags' of undefined
    at resolveNameHelper (/Users/khushbu.raval/Host-FA/Flamingo/hellohealthy.webui/HelloHealthy/HelloHealthy/HelloHealthy.WebUI/node_modules/typescript/lib/typescript.js:32155:45)
    at resolveName (/Users/khushbu.raval/Host-FA/Flamingo/hellohealthy.webui/HelloHealthy/HelloHealthy/HelloHealthy.WebUI/node_modules/typescript/lib/typescript.js:31829:20)

It is working with ng build but not with ng build --prod

Versions:

  1. Angular: 7.2.2
  2. Node: 12.14.1
  3. @twilio-conversations: 2.1.0

Steps already performed to resolve error but still not working:

  1. Downgrading @twilio/conversations version.
  2. Upgrading angular-cli, typescript version.
  3. Delete & reinstall node-modules.
andrewJames
  • 19,570
  • 8
  • 19
  • 51
Khushbu Raval
  • 1,167
  • 1
  • 6
  • 12
  • Are you able to create and share a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of this happening? I don't have an Angular 7 application to test this with myself. If you could provide a repo in which this can be reproduced, I might be able to help. – philnash Jul 18 '22 at 23:28
  • Hi @philnash, here is the public repo - https://github.com/Khushbu-2112/twilio-conversation-demo Can you please check with this: you can set up this in your local system and try to run the command: npm run build to get the same issue I'm having. – Khushbu Raval Jul 20 '22 at 06:05

1 Answers1

0

Solution: I've migrated Angular from version 7 to 8.2.14 to resolve this issue & it worked.

Now I can generate prod build successfully after using Angular V8.

Versions Used:

  1. Node: 14.20.0
  2. Angular: 8.2.14
  3. Twilio-conversation: 2.0.1
Khushbu Raval
  • 1,167
  • 1
  • 6
  • 12