해결된 질문
작성
·
791
0
The file is in the program because:
TS1261: Already included file name 'C:/Users/gram15/Desktop/slack/sleact-master/alecture/pages/LogIn/index.tsx' differs from file name 'C:/Users/gram15/Desktop/slack/sleact-master/alecture/pages/Login/index.tsx' only in casing.
Imported via '@pages/LogIn' from file 'C:/Users/gram15/Desktop/slack/sleact-master/alecture/layouts/App.tsx'
Root file specified for compilation
2 | import loadable from '@loadable/component';
3 | import { Switch, Route, Redirect } from 'react-router-dom';
> 4 | const LogIn = loadable(() => import('@pages/LogIn'));
| ^^^^^^^^^^^^^^
5 | const SignUp = loadable(() => import('@pages/SignUp'));
6 |
7 | const App = () => {
App.tsx
import React from 'react';
import loadable from '@loadable/component';
import { Switch, Route, Redirect } from 'react-router-dom';
const LogIn = loadable(() => import('@pages/LogIn'));
const SignUp = loadable(() => import('@pages/SignUp'));
const App = () => {
return (
<Switch>
<Redirect exact path='/' to="/login" />
<Route path="/login" component={LogIn} />
<Route path="/signup" component={SignUp} />
</Switch>
);
};
export default App;
LogIn/index.tsx
import React from "react";
const LogIn = () => {
return (
<div>로그인</div>
);
};
export default LogIn;
SignUp/index.tsx
import React from "react";
const SignUp = () => {
return (
<div>회원가입</div>
);
};
export default SignUp;
폴더 이름이 맞지 않다고 하는데 이름 대소문자 까지 다 맞춰서 했습니다. 오류가 왜 뜨는지 모르겠어요....
답변 1
1
파일명이 Login인거 아닌가요? LogIn이어야합니다. 다음과 같이 나와있는데 이미 바꾸셨다면 서버를 껐다가 다시 해보세요.
C:/Users/gram15/Desktop/slack/sleact-master/alecture/pages/Login/index.tsx
아 서버를 재시작을 안했네요... 감사합니다