Relative Content

Tag Archive for reactjscreate-react-app

ReactJS Image viewable on localhost (yarn start) but can’t view after build (yarn build)

I inspect the network tab and see that the image contentType being changed to text/html on build version:
build img
The local yarn start version is fine: start img
My build page for you to inspect: https://faf5-wb-2024--faf5-wb-2024-dt78gouq.web.app/49
And it only happened with that image in some pages (unit 7), all other pages is fine, but i don’t have any code to seperate between units
My img render code:

Unable to install create-react-app locally on windows

npm install C:\Users\EG47CU\Downloads\react_packages\create-react-app-main npm ERR! code 1 npm ERR! path C:UsersEG47CUDownloadsreact_packagescreate-react-app-main npm ERR! command failed npm ERR! command C:windowssystem32cmd.exe /d /s /c npm run build:prod -w react-error-overlay npm ERR! > [email protected] build:prod npm ERR! > cross-env NODE_ENV=production node build.js npm ERR! node:internal/modules/cjs/loader:936 npm ERR! throw err; npm ERR! ^ npm ERR! Error: Cannot find module 'cross-spawn' npm ERR! Require stack: npm ERR! - C:UsersEG47CUDownloadsreact_packagescross-env-mastersrcindex.js npm ERR! - C:UsersEG47CUDownloadsreact_packagescross-env-mastersrcbincross-env.js npm ERR! code: 'MODULE_NOT_FOUND', npm ERR! requireStack: [ npm ERR! 'C:\Users\EG47CU\Downloads\react_packages\cross-env-master\src\index.js', npm ERR! 'C:\Users\EG47CU\Downloads\react_packages\cross-env-master\src\bin\cross-env.js' npm ERR! ] npm ERR! npm ERR! Lifecycle script build:prod failed with error: npm ERR! npm ERR! Error: command failed npm ERR! npm ERR! in workspace: [email protected] npm ERR! npm ERR! at location: C:UsersEG47CUDownloadsreact_packagescreate-react-app-mainpackagesreact-error-overlay.