0
0

More than 1 year has passed since last update.

Next JS での TypeError: Failed to construct 'URL': Invalid URL

Last updated at Posted at 2021-10-31

エラーメッセージ

TypeError: Failed to construct 'URL': Invalid URL nextjs


import Image from "next/Image";

...
...
    <Image
        className={stack.landingImage}
        src="/images/hoge.jpg"
        alt="hoge"
        layout="fill"
        objectFit="cover"
        objectPosition="center"
     />

next/Imageでのエラー。

原因

不明。
いくら検索してもパッケージにまつわる話しか出てこなく、また、特に該当ソースやコンフィグファイルをいじっていないに関わらず例外を投げられるようになったため、パッケージマネージャー関連の問題と予想。

解決

結局。プロジェクト全体を作り直して解決した。

やはりパッケージのバージョンの依存関連だろう。

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