Loopback-next: "error TS5056 overwritten by multiple input files" found after upgraded loopback core to 1.10.6 and typescript to 3.7.2

Created on 13 Nov 2019  路  1Comment  路  Source: strongloop/loopback-next

  1. upgraded loopback as below:
   "dependencies": {
-    "@loopback/boot": "^1.5.10",
-    "@loopback/context": "^1.23.4",
-    "@loopback/core": "^1.10.6",
-    "@loopback/openapi-v3": "^1.10.0",
-    "@loopback/repository": "^1.15.3",
-    "@loopback/rest": "^1.22.0",
-    "@loopback/rest-explorer": "^1.4.3",
-    "@loopback/service-proxy": "^1.3.10",
+    "@loopback/boot": "^1.5.11",
+    "@loopback/context": "^1.23.5",
+    "@loopback/core": "^1.10.7",
+    "@loopback/openapi-v3": "^1.10.1",
+    "@loopback/repository": "^1.15.4",
+    "@loopback/rest": "^1.23.0",
+    "@loopback/rest-explorer": "^1.4.4",
+    "@loopback/service-proxy": "^1.3.11",
   },
   "devDependencies": {
-    "@loopback/build": "^2.0.15",
-    "@loopback/eslint-config": "^4.1.3",
-    "@loopback/testlab": "^1.9.3",
+    "@loopback/build": "^2.0.16",
+    "@loopback/eslint-config": "^4.1.4",
+    "@loopback/testlab": "^1.9.4",
-    "typescript": "~3.6.4"
+    "typescript": "~3.7.2"
   }

I clean and rebuild the project, got the below error:

error TS5056: Cannot write file '/home/wayahead/workspace/loopback/pinwheel/besim/dist/datasources/client.datasource.d.ts' because it would be overwritten by multiple input files.

  1. if I roll typescript back 3.6.4, then there is no error. but if checked into @loopback/build/package.json, typescript 3.7.2 is found.

The project and client.datasource.ts was generated by previous version of loopback.

So how to solve this issue caused by loopback upgrading?

bug

Most helpful comment

Either stick with typescript@~3.6.4 or rename <name>.datasource.json to <name>.datasource.config.json. The latest version of @loopback/cli (1.25.0) already generates datasources with the new convention to deal with https://github.com/microsoft/TypeScript/issues/34761.

>All comments

Either stick with typescript@~3.6.4 or rename <name>.datasource.json to <name>.datasource.config.json. The latest version of @loopback/cli (1.25.0) already generates datasources with the new convention to deal with https://github.com/microsoft/TypeScript/issues/34761.

Was this page helpful?
0 / 5 - 0 ratings