You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Type safety when invoking actions](#type-safety-when-invoking-actions)
@@ -356,6 +359,31 @@ If the `my-module` has types, you will not be able to resolve them this way by d
356
359
}
357
360
```
358
361
362
+
### "TypeScript is complaining about multiple copies of the same types!"
363
+
364
+
You may sometimes see TypeScript errors indicating that you have duplicate type definitions for Ember, Ember Data, etc. This is usually the result of an annoying quirk of the way both npm and yarn resolve your dependencies in their lockfiles.
365
+
366
+
#### Just tell me how to fix it
367
+
368
+
There are two options here, neither of them _great_:
369
+
370
+
* manually edit `yarn.lock` or `package-lock.json` and merge the conflicting
371
+
* add a ["resolutions"] key to your `package.json` with the version you want to install of the types you're installing:
If you're using another package which includes these types, and then you trigger an upgrade for your own copy of the type definitions, npm and yarn will both try to preserve the existing installation and simply add a new one for your updated version. In most cases, this is sane behavior, because it prevents transitive dependency breakage hell. However, in the _specific_ case of type definitions, it causes TypeScript to get confused.
386
+
359
387
## Current limitations
360
388
361
389
While TS already works nicely for many things in Ember, there are a number of corners where it _won't_ help you out. Some of them are just a matter of further work on updating the [existing typings]; others are a matter of further support landing in TypeScript itself, or changes to Ember's object model.
0 commit comments