Theme works in dev mode but fails with yarn build:prod

133 views
Skip to first unread message

Tomas Hajek

unread,
Dec 20, 2023, 3:44:47 PM12/20/23
to DSpace Technical Support
Hi all,
  We are running on DSpace version 7.6.1 and working on a theme (basically replacing the default dspace theme).  
  What we have build so far works fine when run in dev mode with yarn start:dev but when I try to build a production dist package to deploy to pm2 with yarn build:prod I get the following error when building:

./src/themes/dspace/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /home/dspace/dspace-angular-src/src/themes/dspace/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.

Two questions on this.
1. Why does this work in dev mode but not when building for prod (my [dspace-angular-src]/config/config.dev.yml and  [dspace-angular-src]/config/config.production.yml files have the same configuration)?
2. Any suggestions on how to fix the error?  Do I need to clear a yarn cache or something maybe?

Thanks
 - Tomas
Reply all
Reply to author
Forward
0 new messages