0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Can't import the named export '{エラー対象の変数名など}' from non EcmaScript module (only default export is available)

Posted at

概要

ng s実行時に大量に下記のようなエラーが出ました。
Can't import the named export '{エラー対象の変数名など}' from non EcmaScript module (only default export is available)

解決法

バージョンの不整合があったのが原因でした。今回の場合angular-in-memory-web-apiというパッケージは最新なのにも関わらずangularのバージョンが11と古かったのが原因だったためひとまずangular-in-memory-web-apiを11にダウングレードして解決確認しました。

package.json
"dependencies": {
        "@angular/animations": "~11.2.12",
        "@angular/common": "~11.2.12",
        "@angular/compiler": "~11.2.12",
        "@angular/core": "~11.2.12",
        "@angular/forms": "~11.2.12",
        "@angular/platform-browser": "~11.2.12",
        "@angular/platform-browser-dynamic": "~11.2.12",
        "@angular/router": "~11.2.12",
        "angular-in-memory-web-api": "^0.11.0"
      },
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?