Skip to content

Critical dependency: the request of a dependency is an expression | UnhandledPromiseRejectionWarning: Error: package.json does not exist #2284

Closed
@kuncevic

Description

@kuncevic

After adding @angular/fire to the project the Angular universal prerender breaks. It shows this warnings at first:

WARNING in ./node_modules/grpc/src/grpc_extension.js 32:12-33
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/grpc/node_modules/node-pre-gyp/lib/pre-binding.js 20:22-48
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/grpc/node_modules/node-pre-gyp/lib/util/versioning.js 17:20-67
Critical dependency: the request of a dependency is an expression 

and then it breaks with this error:

Prerendering 1 route(s) to /Projects/firebase-issue/dist/firebase-issue/browser
(node:41122) UnhandledPromiseRejectionWarning: Error: package.json does not exist at /Projects/firebase-issue/dist/firebase-issue/package.json
    at Object.PsoT.exports.find (/Projects/firebase-issue/dist/firebase-issue/server/main.js:1:2061155)
    at Object.wPNL (/Projects/firebase-issue/dist/firebase-issue/server/main.js:1:3688583)
    at __webpack_require__ (/Projects/firebase-issue/dist/firebase-issue/server/main.js:1:295)
    at Object.XpdW (/Projects/firebase-issue/dist/firebase-issue/server/main.js:1:2342088)
    at __webpack_require__ (/Projects/firebase-issue/dist/firebase-issue/server/main.js:1:295)
    at Object.g1pB (/Projects/firebase-issue/dist/firebase-issue/server/main.js:1:3064029)
    at __webpack_require__ (/Projects/firebase-issue/dist/firebase-issue/server/main.js:1:295)
    at Object.Ou8q (/Projects/firebase-issue/dist/firebase-issue/server/main.js:1:2035913)
    at __webpack_require__ (/Projects/firebase-issue/dist/firebase-issue/server/main.js:1:295)
    at Object.BYZf (/Projects/firebase-issue/dist/firebase-issue/server/main.js:1:1191093)
(node:41122) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:41122) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Jan-12-2020 09-57-57

Version info

Angular:
9.0.0-rc.8
Firebase:
7.6.2
AngularFire:
5.3.0
Other (e.g. Ionic/Cordova, Node, browser, operating system):

"@nguniversal/express-engine": "9.0.0-rc.0",
"@angular/cli": "9.0.0-rc.8",
"@nguniversal/builders": "9.0.0-rc.0",

node v12.13.1

How to reproduce these conditions

  1. git clone https://github.com/kuncevic/firebase-issue
  2. yarn
  3. npm run prerender

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions