質問編集履歴
1
OSと起動後のエラーメッセ-ジ時追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
npx create-react-app my-appでReactのアプリを作成しVSCodeで開いて実行しようとしたところ下記のエラーが発生しました。
|
2
2
|
作成してからコードはいじっておらず原因が分かりませんので教えて下さい。
|
3
|
+
OSはWindowsです。
|
3
4
|
```
|
4
5
|
Uncaught SyntaxError c:\Users\デスクトップ\作業用フォルダー\react\my-app\src\App.js:1
|
5
6
|
import logo from './logo.svg';
|
@@ -21,4 +22,26 @@
|
|
21
22
|
C:\Program Files\nodejs\node.exe .\src\App.js
|
22
23
|
Uncaught SyntaxError SyntaxError: Unexpected token '<'
|
23
24
|
```
|
25
|
+
|
26
|
+
npm startを実行したところサーバーは起動したのですがhttp://localhost:3000/を開いたら画面に下記のようなメッセージがでてきました。
|
27
|
+
```
|
28
|
+
The extension in the request is mandatory for it to be fully specified.
|
29
|
+
Add the extension to the request.
|
24
|
-
n
|
30
|
+
ERROR in ./src/index.js 8:0-24
|
31
|
+
Module not found: Error: Can't resolve './App' in 'C:\Users\デスクトップ\作業用フォルダー\react\my-app\src'
|
32
|
+
Did you mean 'App.js'?
|
33
|
+
BREAKING CHANGE: The request './App' failed to resolve only because it was resolved as fully specified
|
34
|
+
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
|
35
|
+
The extension in the request is mandatory for it to be fully specified.
|
36
|
+
Add the extension to the request.
|
37
|
+
|
38
|
+
ERROR in ./src/index.js 9:0-48
|
39
|
+
Module not found: Error: Can't resolve './reportWebVitals' in 'C:\Users\デスクトップ\作業用フォルダー\react\my-app\src'
|
40
|
+
Did you mean 'reportWebVitals.js'?
|
41
|
+
BREAKING CHANGE: The request './reportWebVitals' failed to resolve only because it was resolved as fully specified
|
42
|
+
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
|
43
|
+
The extension in the request is mandatory for it to be fully specified.
|
44
|
+
Add the extension to the request.
|
45
|
+
|
46
|
+
webpack compiled with 2 errors
|
47
|
+
```
|