19
6

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 3 years have passed since last update.

Webpack+BabelでReactの環境構築時に"Support for the experimental syntax 'jsx' isn't currently enabled"が出たときの解消メモ

Last updated at Posted at 2021-02-08

#結論
npmまたはyarnを用いて@babel/preset-reactをinstall

npm:

npm install --save-dev @babel/preset-react

yarn:

yarn add -D @babel/preset-react

.baelrc に以下を記述

.babelrc
{
  "presets": ["@babel/preset-env","@babel/preset-react"]
}

引用元 https://babeljs.io/docs/en/#jsx-and-react

#原因
Webpack+BabelでReactの開発環境構築をしている際に、React用のpresetを導入していなかったために起きた。

#メモ
これ単体で検索かけても解決に至らなかったため、公式サイトに情報がないかと探したら一番上に書いてあった.....。
なにかあったら公式ドキュメントを読んだ方が速そう。

19
6
1

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
19
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?