question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

building client errors: ERROR in node_modules/apollo-utilities/lib/util/mergeDeep.d.ts(2,52): error TS2370: A rest parameter must be of an array type.

See original GitHub issue

we’re trying to build our angular app in docker but apollo errors: ERROR in node_modules/apollo-utilities/lib/util/mergeDeep.d.ts(2,52): error TS2370: A rest parameter must be of an array type. we’ve already updated all our dependencies to the latest version to try and fix this but no luck. Any ideas would be most welcome.

Intended outcome:

building the client in docker

Actual outcome:

ERROR in node_modules/apollo-utilities/lib/util/mergeDeep.d.ts(2,52): error TS2370: A rest parameter must be of an array type.

Versions System: OS: macOS Sierra 10.12.6 Binaries: Node: 8.11.3 - /usr/local/bin/node Yarn: 1.9.4 - /usr/local/bin/yarn npm: 6.5.0 - /usr/local/bin/npm Browsers: Chrome: 72.0.3626.121 Firefox: 65.0.1 Safari: 12.0.3

package.json:


{
  "name": "client",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --port 4200 --host 0.0.0.0 --poll 500 --proxy-config proxy.config.json",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "update:schema": "apollo schema:download --endpoint http://0.0.0.0:8000/graphql ./src/app/graphql/schema.json",
    "update:types": "apollo codegen:generate --schema ./src/app/graphql/schema.json --target=typescript"
  },
  "apollo": {
    "schemas": {
      "api": {
        "schema": "src/app/graphql/schema.graphql",
        "endpoint": "http://0.0.0.0:8000/graphql"
      }
    },
    "queries": [
      {
        "schema": "api",
        "includes": [
          "**/*.ts"
        ],
        "excludes": [ "node_modules/**"
        ]
      }
    ]
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.9",
    "@angular/cdk": "^7.3.4",
    "@angular/common": "^7.2.9",
    "@angular/compiler": "^7.2.9",
    "@angular/core": "^7.2.9",
    "@angular/flex-layout": "6.0.0-beta.18",
    "@angular/forms": "^7.2.9",
    "@angular/http": "^7.2.9",
    "@angular/material": "^7.3.4",
    "@angular/platform-browser": "^7.2.9",
    "@angular/platform-browser-dynamic": "^7.2.9",
    "@angular/router": "^7.2.9",
    "apollo-angular": "^1.5.0",
    "core-js": "^2.6.5",
    "rxjs": "^6.4.0",
    "zone.js": "~0.8.29",
    "apollo-angular-link-http": "^1.5.0",
    "apollo-link": "^1.2.11",
    "apollo-client": "^2.5.1",
    "apollo-cache-inmemory": "^1.5.1",
    "graphql-tag": "^2.10.1",
    "graphql": "^14.1.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.6",
    "@angular/cli": "~7.3.6",
    "@angular/compiler-cli": "^7.2.9",
    "@angular/language-service": "^7.2.9",
    "@types/jasmine": "~3.3.10",
    "@types/jasminewd2": "~2.0.6",
    "@types/node": "~11.11.3",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~3.3.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.5",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.2",
    "ts-node": "~8.0.3",
    "tsc-watch": "^2.1.2",
    "tslint": "~5.14.0",
    "typescript": "^3.3.3333"
  }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dutchsparkscommented, Mar 18, 2019

I can’t test it right now but downgrading apollo-utilities to 1.0.22 might work. let me know how it goes if you give it a try.

1reaction
benjamncommented, Mar 18, 2019

Likely duplicate of https://github.com/apollographql/apollo-client/issues/4506.

tl;dr If you can update the typescript package to at least 3.0, this error should go away, per https://github.com/apollographql/apollo-client/issues/4501#issuecomment-468001034. Since the original poster seems to be using typescript@3.3.3333, I would ask that they double-check there are no other copies of the typescript package in use.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A rest parameter must be of an array type - typescript
when i try to create build using ionic cordova build android --prod i am getting errors with too many lines in file typescript: ......
Read more >
error TS2370: A rest parameter must be of an array type. - Reddit
I'm trying to start an older angular application in docker. But when I run "docker-compose up --build" the client fails to compile because ......
Read more >
Node_modules/@types/jest/index.d.ts:39:31 - error TS2370
Node_modules/@types/jest/index.d.ts:39:31 - error TS2370: A rest parameter must be of an array type · Languages Node.js · build-env.
Read more >
"error TS2370: A rest parameter must be of an array type" error ...
ASP.NET Core Angular Reporting project template - "error TS2370: A rest parameter must be of an array type" error occurs in the "knockout.d.ts" ......
Read more >
Rest parameter must be an array type or a generic ... - YouTrack
Incorrect Error: Rest parameter must be an array type or a generic with array constraint with typescript Parameters utility type. Attachments 1. screen.png....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found