Dspace 7.2 build:prod fails to build the expected dist/server directory.

192 views
Skip to first unread message

Eric Montague

unread,
Feb 25, 2022, 6:54:01 PM2/25/22
to DSpace Technical Support
However, both start:dev and start:prod succeed.

build:prod fails to build the expected dist/server directory.
The 7.2 dist/server directory ends up with 85 items instead of 4 items
like in 7.1 (See attached.)
It appears the build ends before all of the .js files have been bundled
into main.js

The build:prod terminal output is attached.

This is prod.yml

ui:
  ssl: false
  host: localhost
  port: 4000
  nameSpace: /

rest:
  ssl: true
  host: myarchive.net
  port: 443
  nameSpace: /server

Running Windows Server 2019
Visual Studio Code

Any idea what's going on here, or how I can debug this?

- Eric

build-prod.txt
dist-server-folder-7.1.png
dist-server-folder-7.2.png

Tim Donohue

unread,
Feb 28, 2022, 11:03:27 AM2/28/22
to DSpace Technical Support
Hi Eric,

Have you tried running the app via "yarn run serve:ssr" after that "yarn build:prod"?  Does it result in errors?

I did want to note that the build process between 7.1 and 7.2 *did change*.  So, it's not unexpected for the resulting "dist" folder to be bigger...because we changed the build process to no longer be dependent on a separate "node_modules" folder.  This means that more content is added to the "dist" folder to make it standalone. For more info, see https://github.com/DSpace/dspace-angular/issues/1410 and https://github.com/DSpace/dspace-angular/pull/1412

So, comparing the "dist" output doesn't really matter here.

Was there any more information given when you ran "yarn build:prod"?  The odd thing here is that "yarn start:prod" *runs* "yarn build:prod" followed by "yarn run serve:ssr".  See: https://github.com/DSpace/dspace-angular/blob/main/package.json#L10 

So, if "yarn start:prod" is working, then that implies that your app **is building properly**.  But, then it's a mystery to me why "build:prod" would fail.

If you discover more clues, let us know on this list.

Tim

Eric Montague

unread,
Feb 28, 2022, 5:40:33 PM2/28/22
to dspac...@googlegroups.com

I found the problem.

I use NSSM to manage the front end service.
NSSM for
        front end

Upon closer inspection, I discovered that the arguments for node changed from
    "serve:ssr": "node dist/server" in 7.1 to
    "serve:ssr": "node dist/server/main" in 7.2
Once I  used the correct arguments for 7.2, the node service started fine.

When the service did not start correctly using the 7.1 arguments,
the first thing I noticed was that the dist/server files had changed a lot and thought the new build
might have failed somehow.

Thanks Tim.

- eric

--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/70f3d39f-935f-47ef-b75d-dc89bcde02c6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages