ERROR in ./src/pages/Shop.js 5:0-71 Module not found: Error: Can't resolve
ERROR in ./src/pages/Shop.js 5:0-71
Module not found: Error: Can't resolve 'C:/education/reactjs/src/components/itemlist.js' in 'C:\education\reactjs\src\pages' webpack compiled with 1 error and 1 warning вот сам код |
Как пофиксить?
|
Цитата:
Цитата:
Проверить, что файл существует по указанному пути и, в случае его отсутствия, либо добавить его, либо исправить путь к этому файлу. |
index.js:
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<App />
);
App.js:
import React from 'react';
import Shop from './pages/Shop.js';
function App() {
return (
<div className="App">
<Shop/>
</div>
);
}
export default App;
Shop.js
import React from 'react';
import Itemslist from '../components/itemslist.js';
const Shop = () => {
return (
<div>
<Itemslist/>
</div>
);
};
export default Shop;
itemslist.js:
import React from 'react';
import Item from './item.js';
const Itemslist = () => {
return (
<div>
<item id={'1'} text={'hello world'}/>
</div>
);
};
export default Itemslist;
item.js
import React from 'react';
const Item = ({text}) => {
return (
<div>
{text}
</div>
);
};
export default Item;
ошибок не выдыет hello world не выводит |
Цитата:
Цитата:
Цитата:
|
| Часовой пояс GMT +3, время: 18:13. |