0

I have an Angular 13 project which uses Angular Universal (SSR). One of my dependencies (that I also develop) is for the server portion only. When building the project on development mode with ng run project:server --configuration=development the project builds but when running it I get this error:

$ node dist/project/server/main.js
/CODE/project/dist/project/server/main.js:152487
/* harmony export */   "ReadableResource": () => (/* reexport safe */ _readable__WEBPACK_IMPORTED_MODULE_2__.ReadableResource),
                                                                                                             ^

TypeError: Cannot read properties of undefined (reading 'ReadableResource')
    at Module.ReadableResource (/CODE/project/dist/project/server/main.js:152487:110)
    at Module.51801 (/CODE/project/dist/project/server/main.js:153393:64)
    at __webpack_require__ (/CODE/project/dist/project/server/main.js:278610:42)
    ...

However if I run the same builder with production configuration, there are no runtime errors and the library can be used without problems. All I have found so far is that Webpack is involved in the dev build and (maybe) not in the prod build but I don't know what to do with that.

Any help is appreciated.

1 Answer 1

1

to run angular universal app in dev mode you need to run this command:

npm run dev:ssr

or:

ng run project:serve-ssr
Sign up to request clarification or add additional context in comments.

1 Comment

The serve:ssr architech uses the dev configuration, which is the one that I have problems with so this does not work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.