Server error: File /src/main.jsx not found (resolving id: /src/main.jsx)
P粉421119778
P粉421119778 2023-11-22 20:07:28
0
1
548

I typed "npm run dev" to run the application but I got this error: "Unable to load url /src/main.jsx (resolved id: /src/main.jsx). Does the file exist?" and the page is white. Code written in main.jsx:

import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import './index.css'

ReactDOM.createRoot(document.getElementById('root')).render(
  <React.StrictMode>
    <App/>
  </React.StrictMode>,
)

I need quick help, thank you

I tried restarting VS Code and the server but it didn't work I tried "npm i" but it didn't work either

P粉421119778
P粉421119778

reply all(1)
P粉938936304

I encountered the exact same error because my project path was too long.

The path of my project is C:\Users\User\Documents\1 My Projects\C#\Complex\MyAwesomeProject API_REACT_DOCKER\ProfileWebApp

I moved the project to C:\Users\User\Documents\MyAwesomeProject

It solves this problem.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!