시간 index.js 오류가 나요 ㅠ
409
작성한 질문수 2
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
//import App from './App';
//import reportWebVitals from './reportWebVitals';
import Clock from './chapter_04/clock';
const root = ReactDOM.createRoot(document.getElementById('root'));
setInterval(() => {
root.render(
<React.StrictMode>
<Clock />
</React.StrictMode>
);
}, 1000);import React from "react";
const Clock = () => {
return(
<div>
<h1>안녕, 리엑스</h1>
<h2>현재 시간: {new Date().toLocaleTimeString}</h2>
</div>
)
}
export default Clock;Failed to compile.
Module not found: Error: Can't resolve './chapter_03/Library' in 'C:\reactdeveloper\reactcoding\my-app\src'
WARNING in [eslint]
src\index.js
Line 4:8: 'App' is defined but never used no-unused-vars
Line 5:8: 'reportWebVitals' is defined but never used no-unused-vars
Line 7:8: 'Library' is defined but never used no-unused-vars
Failed to compile.
Module not found: Error: Can't resolve './chapter_03/Library' in 'C:\reactdeveloper\reactcoding\my-app\src'
WARNING in [eslint]
src\index.js
Line 4:8: 'App' is defined but never used no-unused-vars
Line 5:8: 'reportWebVitals' is defined but never used no-unused-vars
Line 7:8: 'Library' is defined but never used no-unused-vars
Failed to compile.
Module not found: Error: Cannot find file: 'clock.jsx' does not match the corresponding name on disk: '.\src\chapter_04\Clock.jsx'.
ERROR in ./src/index.js 10:0-39
Module not found: Error: Cannot find file: 'clock.jsx' does not match the corresponding name on disk: '.\src\chapter_04\Clock.jsx'.
webpack compiled with 1 error이렇게 오류가 나고 있는데 해결 방법이 있을까요
답변 1
0
안녕하세요, 소플입니다.
현재 로그 상으로는 import한 파일 경로가 잘못된 것 같은데 다시 한 번 경로를 한 번 확인해보시기 바랍니다.
그리고 VS Code 화면이나 에러 로그가 발생하는 브라우저의 콘솔 로그 등을 캡처해서 첨부해 주시면 더 정확한 답변을 드릴 수 있을 것 같습니다.
감사합니다.
강의가 삭제되었다고 합니다
0
106
1
이거 왜 존재하지 않는다고 뜨는건가요
0
133
1
존재하지 않는 수업이라고 떠요
0
183
1
안드로이드 에뮬레이터 오류
0
100
1
교재 구입해서 강의 들으려고 하는데 커리큘럼이 없어졌어요.
0
126
1
prevIsConfiromed 질문
1
141
2
chapter14 잘이해가 되지않습니다..
1
135
2
2025년 3월 리액트버전
1
202
2
npm 설치 오류
1
175
1
chapter_07 콘솔로그 질문드려요~!
1
128
2
안녕하세요 미니블로그 실습 질문드립니다.
1
178
3
에러가 떠요
1
219
3
Chapter6 질문 드립니다
1
209
2
실습 코드 있을까요?
1
206
2
상태가 업데이트될때 컴포넌트 최상단의 console.log 코드가 두번 실행되는 이유가 궁금합니다.
1
233
2
npx create-react-app my-app 명령어 입력이 잘못된 것 같습니다
0
308
3
이름과 코멘트 줄바꿈이 안 됩니다.
0
140
1
버튼이 안 뜹니다
0
303
2
npx create-react-app my-app
1
470
2
jsx 코드 작성해보기에서 index.js 수정 후 에러 뜹니다.
1
376
3
Chapter_05 터미널, 리액트 에러
0
193
2
npx create-react-app my-app 명령어 반응없음
1
432
3
import 코드 에러
1
214
1
백틱
1
121
1





