프로그래밍
-
cloud functions express cors error with typescript | 오류, 에러, 버그프로그래밍/버그(bug) 2022. 8. 11. 17:24
소스 코드 import * as express from "express"; import * as cors from "cors"; const app = express(); app.use(cors({ origin: true })); 기존의 express 설정시 사용하던 방법이랑 동일하다. cors 설정이 완료됐다. 그런데...... cloud functions 관련해서 아직도 cors 버그에 대한 질문과 답변이 계속 생긴다. 분명 예전에도 삽질을 했던 부분인데 또 보고 있었다. 알고보니 사실 cors 관련 버그가 아닌 경우도 많았다. (나도 그런 경우) cors 관련 소스를 넣고 분명 오류 없이 정상적으로 컴파일이 됐는데, cors 오류가 계속 발생해서 아주 미칠고 환장할뻔 했다. 오류 상황 typescri..
-
[오류 해결] serviceAccount is not assignable to parameter of type 'string | ServiceAccount'. | firebase cloud functions프로그래밍/흔적 2022. 8. 10. 20:34
소스 코드 admin.initializeApp({ credential: admin.credential.cert(serviceAccount), }); 오류 메시지 import serviceAccount Argument of type '{ type: string; project_id: string; private_key_id: string; private_key: string; client_email: string; client_id: string; auth_uri: string; token_uri: string; auth_provider_x509_cert_url: string; client_x509_cert_url: string; }' is not assignable to parameter of type ..
-
typescript json import 방법 | 오류, 에러, 버그프로그래밍/버그(bug) 2022. 8. 10. 20:22
소스 코드 import * as serviceAccount from "./serviceAccount.json"; 오류 메시지 "Cannot find module './serviceAccount.json'. Consider using '--resolveJsonModule' to import module with '.json' extension.ts(2732)" 해결 방법 tsconfig.json에 추가 설정을 해줘야한다. { "compilerOptions": { // ... other options "resolveJsonModule": true, "esModuleInterop": true, // "moduleResolution": "node" } } 추가 설명 "resolveJsonModule": true..
-
codeload github 주소 의미 해석프로그래밍/흔적 2022. 8. 9. 15:43
예시 명령어 curl https://codeload.github.com/mui/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/nextjs-with-typescript codeload.github.com github 파일 다운로드 및 보관을 위한 캐싱 목적의 subdomain mui github 계정 소유자 id (owner) material-ui 해당 계정의 repository 이름 (repo) tar.gz 다운로드 받을 압축파일 형식 (tar, zip 등) master branch 이름 ( 주로 main, master ) tar 관련 명령어 -xz x는 압축해제, z는 gzip 사용 —strip=2 상위 2개의 경로를..
-
[React MUI] - 1분만에 nextjs, material ui, typescript 설치 및 사용하기프로그래밍/흔적 2022. 7. 28. 00:09
요약 1. Material-UI, NextJS, Typescript 적용된 프로젝트 다운로드 curl https://codeload.github.com/mui/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/nextjs-with-typescript 2. 폴더 이동 후 패키지 설치 cd nextjs-with-typescript && npm install 3. 실행 (아래는 실행결과) npm run dev 주의 사항 package.json에 의존성들이 모두 latest로 되어 있음으로 배포시 문제가 생길 수 있다. 따라서 학습용이 아니라면 패키지들을 모두 개별로 설치 해주자. (혹은 버전을 모두 적어주거나) npm insta..
-