Rajib Mahmud
Rajib Mahmud

Reputation: 31

How can i fix "Failed to Compile" in npm for react application developing?

Its my first test app. but why its not compiled. i couldn't figure it out. Can anyone explain please.

image of cmd

image of cmd1

index.html file

app.jsx file

main.js file

package.json file

webpack.config.js file

Upvotes: 1

Views: 48

Answers (1)

Ben Smith
Ben Smith

Reputation: 20230

Your index.html file is referencing "index.js", but from the screenshots you have provided it looks as though you don't have this, but instead you have "main.js".

Hence change "index.html" to reference "main.js" i.e.

<script src='main.js'></script>

Also there's a typo in main.js, change "ducument" to "document".

Upvotes: 1

Related Questions