'Response' is not assignable to type 'Response'

Responseを参照する自作ライブラリを使用しようとしたら謎のエラーが。
調べてみたらこんな感じになってた。

my-application
└node_modules
  ├@angular
  └my-library
    └node_modules
      └@angular

my-library中のmode_modulesを削除したら解決。


my-libraryのpackage.jsonのdependenciesと、my-applicationのpackage.jsonのdependenciesに設定されている、共通する依存ライブラリのバージョンが違うとこうなるっぽい?


アプリケーション側でもdependenciesに書くライブラリの場合は依存関係はdevDependencies(とpeerDependencies)に書き、dependenciesには書かないのが良いっぽい?

AOTで画像のインポートをするとCannot find moduleと言われる

Cannot find module '../assets/images/icon.gif'.

だそうだ。
怒られているコードはこんな感じ。

import {Component} from '@angular/core'
import * as icon from '../assets/images/icon.gif'

requireに変えるとコンパイラの怒りが鎮まる。

import {Component} from '@angular/core'
const icon = require('../assets/images/icon.gif')


んーでも前AOTでrequire使ってたら怒られてた気がするんだけどなあ…。
コンポーネント定義中で使うのはだめだけど、それさえ静的に解決できてれば他では使っていいってことかな。