Problem with component in React.jsx

I’m trying to create a navbar with React.jsx but apper the error “[plugin:vite:import-analysis] Failed to resolve import “.pages/Pricing” from “src\App.jsx”. Does the file exist?”

import React from 'react'
import Navbar from './Navbar'
import Pricing from '.pages/Pricing'
import About from '.pages/About'
import Home from '.pages/Home'



function App() {
  let component
  switch(window.location.pathname){
    case "/home":
      component = <Home />
      break
    case "/pricing":
    component = <Pricing />
    break
    case "/about":
    component = <About />
    break  
  }
  return (
    <div className="App">
      <>
      <Navbar />
      {component}
      </>
    </div>
  )
}

export default App

Actual error

I assume it’s a folder in the same directory called pages, not .pages, ie ./pages/

1 Like

Terimakasih Banyak atas bantuanya Mr. DanCouper :flushed:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.