motorcycle.ts icon indicating copy to clipboard operation
motorcycle.ts copied to clipboard

Type 'EventMap[K]' does not satisfy the constraint 'Event'

Open mspoulsen opened this issue 6 years ago • 5 comments

When trying the counter example I get the following with the latest version of typescript installed:

ERROR in .../motorcycle.ts/examples/counter/node_modules/mostly-dom/lib/types/VNodeEventTypes.d.ts (7,54): error TS2344: Type 'EventMap[K]' does not satisfy the constraint 'Event'. webpack: Failed to compile.

Any clues?

mspoulsen avatar Jun 01 '18 15:06 mspoulsen

Updating dependencies worked. Other examples are broken as well and require code changes.

elbaro avatar Jun 12 '18 16:06 elbaro

Hmmm...what dependencies? Can you paste your package.json? Thnx!

mspoulsen avatar Jun 12 '18 19:06 mspoulsen

yarn outdated tells you what can be updated.

   "dependencies": {
-    "@motorcycle/dom": "16.0.0",
-    "@motorcycle/mostly-dom": "4.0.0",
-    "@motorcycle/run": "4.0.0",
-    "@motorcycle/stream": "2.0.0"
+    "@motorcycle/dom": "17.0.0",
+    "@motorcycle/mostly-dom": "5.0.0",
+    "@motorcycle/run": "5.0.0",
+    "@motorcycle/stream": "3.0.0",
+    "@typed/prelude": "5.0.0",
+    "typescript": "^2.9.1"
   },
   "devDependencies": {
-    "@types/node": "8.0.28",
-    "ts-loader": "2.3.7",
-    "webpack": "3.5.6",
-    "webpack-dev-server": "2.7.1"
+    "@types/node": "10.3.2",
+    "ts-loader": "4.4.1",
+    "webpack": "4.12.0",
+    "webpack-cli": "^3.0.4",
+    "webpack-dev-server": "3.1.4"
   }

elbaro avatar Jun 13 '18 09:06 elbaro

Thanks! :)

mspoulsen avatar Jun 16 '18 08:06 mspoulsen

I still get this message when I run my tests with @typed/[email protected]. Has @typed/test been replaced by something new?

node_modules/@motorcycle/mostly-dom/node_modules/mostly-dom/lib/types/VNodeEventTypes.d.ts
(7,54): Type 'EventMap[K]' does not satisfy the constraint 'Event'.

What can I do about this error mesage?

mspoulsen avatar Jun 29 '18 08:06 mspoulsen