The last major React-related topic we are going to look at is less about React and more about setting up your development environment to build a React app. Up until now, we've been building our React apps by including a few script files:
ERROR in Entry module not found: Error: Canât resolve âbabelâ in â/Users/GradioMedia/Desktop/MyTotallyAwesomeAppâ
BREAKING CHANGE: Itâs no longer allowed to omit the â-loaderâ suffix when using loaders.
You need to specify âbabel-loaderâ instead of âbabelâ,
see https://webpack.js.org/guides/migrating/#automatic-loader-module-name-extension-removed
Luckily itâs an easy fix with simply modifying the webpack.config.js file by adding â-loaderâ to the end of babel:
@kirupa thats an amazing tutorial i am newbie and wanted to know that I have followed the stepsâŚhow will it be running in localhost? there is no web-dev-server here so how localhost will be running?
Unless your app is doing something that absolutely needs a server, you can do a lot using just the file system. That is why I originally didnât mention anything about that.
With that said, I should update the article to mention using a web server, though. It is good practice. Thanks for letting me know. Iâll look into getting this revised soon
@kirupa Thanks for the great tutorial, i am waiting for âhow to setup web server for this index.htmlâ please update this tutorial for the next steps.
oh - it seems that the original post shows the images, but clicking âview full postâ does not show them. It seems that the images that work have a missing â/react/â from the file path!
I never even noticed that button! These posts get auto-generated when content on the main kirupa.com site is posted, and the URL for showing the full version is broken. Thatâs why images donât load. Iâll fix that shortly. Thanks for pointing that out
one more question - Iâm getting some misprinted spaces in my end result Ă and Iâm not sure why. They even show up when I pretty much copy-pasted the entire exercise. Any ideas?
Tyler - are you double clicking inside the code area before copying? If so, that is a bug that I will need to fix where spaces get introduced. If you copy the code by just selecting without double-clicking, you shouldnât see the space characters. Can you try that and see if it works for you?
This is a great tutorial. It took 5 minutes and now Iâm ready to go. Most tutorials lightly cover or skip entirely the initial setup, and the installation on the React website is a little too in depth. This is just right. Thanks, man. Cheers
ERROR in ./dev/index.jsx
Module parse failed: /Users/dstonehill/Documents/ReactProjects/ReactApi/dev/index.jsx Unexpected token (7:6)
You may need an appropriate loader to handle this file type.
| render: function() {
| return (
|