Help, please : the file index-7b69cdca.js was not found, it says: "No resource with given URL found"

Hello everybody :slightly_smiling_face: ,

I need your help, please.

I just deployed my Portfolio on the Netlify Platform. The deployment was successful.
However, when I click on the link to my Portfolio “”, I get a blank page.

After investigating the cause of the issue, I discovered these error messages in the console: ReferenceError: React is not defined index-7b69cdca.js:32
Uncaught ReferenceError: React is not defined index-7b69cdca.js:32
And I realized that in the Application section → Frames → the file index-7b69cdca.js was not found, it says: “No resource with given URL found”.
I don’t understand why this file is not found because I have an index.html file at the root of my project as well as an index.html file in the dist folder created by the Netlify Platform.
And locally the code works perfectly fine, and there are no issues with the React library.

Furthermore, I have checked and all dependencies seem to be up to date and correctly installed… I ran the npm install command.

I also created a _redirects file which I placed in the public folder, and it was indeed copied to the dist folder during deployment.

So I don’t understand this error, please help me, I would be very grateful!

Here is my Github link: " GitHub - Marine-Lautissier/Portfolio"

Here is the configuration of my package.json file:
“name”: “portefolio”,
“private”: true,
“version”: “0.0.0”,
“type”: “module”,
“jsx”: “react-jsx”,
“scripts”: {
“dev”: “vite”,
“build”: “vite build”,
“lint”: “eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0”,
“preview”: “vite preview”
“dependencies”: {
“react”: “^18.2.0”,
“react-dom”: “^18.2.0”,
“react-feather”: “^2.0.10”,
“react-simple-typewriter”: “^5.0.1”
“devDependencies”: {
@types/react”: “^18.2.15”,
@types/react-dom”: “^18.2.7”,
@vitejs/plugin-react”: “^4.0.3”,
“babel-plugin-macros”: “^3.1.0”,
“eslint”: “^8.45.0”,
“eslint-plugin-react”: “^7.32.2”,
“eslint-plugin-react-hooks”: “^4.6.0”,
“eslint-plugin-react-refresh”: “^0.4.3”,
“vite”: “^4.4.5”

Here is the configuration of the Netlify build:
Runtime: Not set
Base directory: /
Package directory: Not set
Build command: npm run build
Publish directory: dist
Functions directory: netlify/functions
Deploy log visibility: Logs are public
Build status: Active

In advance, I thank you very much! :pray:

@Marinette This isn’t specific to running your build on Netlify, your project is just broken.

Running your repo I see exactly the same issue with npm run build && npx serve -s dist and with npm run dev

Runing locally via npm run dev provides better error messages:

I’m not going to dig in too deeply but it seems to need React to be available in the context of your various components, and it isn’t.

I was able to get your site to execute with no errors by placing import React from 'react' into each of the components/*.jsx files.

1 Like

Oh, thank you so much ! It works ! Thank you infinitely ! :pray: :smile: