Production postcss file mapping error ./

Hey there! I uploaded all of my git commits to my git repo here and I’m using Netlify’s continuous Deployment functionality. While looking at the production build logs I saw this error appear that I never experienced during development.

I went to change it but I noticed that node modules are never uploaded to my git repo meaning they are never uploaded to netlify :man_facepalming:. So I was confused how I was supposed to solve this thanks.

Hi @Musa

This is because node_modules is in the .gitignore at the root of the repository.

This is normal. Netlify doesn’t need you to upload them. The Netlify Build Bots download the required modules based on the dependencies and devDependencies in the package.json in the root of the repository.

The error in the screenshot relates to this package which isn’t a direct dependency in your project but a dependency of react-scripts which is currently v4.0.3 in your project, but v5.0.0 is now available.

Check out Updating packages downloaded from the registry | npm Docs on how to update the packages used in your project to the latest versions which may remove this warning.

Haha I understand that I put its path in the gitignore, but thank you for the answer to the postcss error! Ill try it right now

Back again, my react-scripts is not updating whatsoever, and it says

The semver (in the case of react-scripts) of 4.0.3 is as high as it can go. To upgrade this package from a v4 to a v5 you will need to explicitly specify the version e.g. npm install react-scripts@5.0.0.

Here is the nodeJS explanation of semver (a little dry perhaps reading perhaps.)

Hey, colemay I uninstalled react-scripts using the link you gave me, tried to update it using npm i react-scripts@5.0.0 however this error now prevails.

@Musa If you look closely at the error you will see that you have a typo.
You have written react-scipts@5.0.0 instead of react-scripts@5.0.0.

Right, thanks @nathanmartin I reinstalled react-scripts to its latest version however I get much more detrimental errors that werent present when using react-scripts 4.0.3.

Here are some, because I wanted to keep my project “working” I decided to install react-scripts 4.0.3 again here are the error from the latest react-version

Did you try doing as the error suggested? Looks like you simply need to add the file extension to the import statements.

No, because I don’t think that should be a problem its even throwing it in module inside of a package

This issue might interest you in that case:

I did try to make it ./homepage.js but more errors came

This website is due by today are there any other options i can take.

I don’t think so. From the issue I linked above, this doesn’t seem to be a Netlify-specific problem. You can choose to stay on a version that’s working.

Why would create-react-app install a later version of react-scripts for me. I built the app on v4 with zero errors and now I come to v5 its broken. Is there any way for me to avoid this with future projects. Where am I able to determine the version of dependencies a command will install for me.

This would likely come down to the version of create-react-app used to configure the project. Using create-react-app (version 5.0.0) to set up a new project adds react-scripts@5.0.0.

If you have the project set up, there is no need to use create-react-app.

The version of a package is listed in the package.json file in the repository.

I downloaded the code in your repository (which still has react-scripts@4.0.3 and was able to run it locally.

The version of a package is listed in the package.json file in the repository.

Yes I understand that it’s just that is there any website of react that tells me the versions of the dependencies before I download it.

The version of react-scripts installed by create-react-app matches the version of create-react-app. So if you use create-react-app@5.0.0 it will install react-scripts@5.0.0 as noted from the GitHub create-react-app releases.