본문 바로가기
728x90
반응형

프로그래밍58

자바스크립트 에러 메시지 해결 Refused to load the script 'https://t1.daumcdn.net/kas/static/ba.min.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'unsafe-inline' giscus.app daumcdn.net". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. 보안 정책 문제임 아래 링크 참고 https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP 2022. 5. 4.
Server Error ReferenceError: window is not definedThis error happened while generating the page. Any Server Error ReferenceError: window is not definedThis error happened while generating the page. Any console logs will be displayed in the terminal window. import dynamic from 'next/dynamic' const DynamicComponent = dynamic(() => import('../components/hello')) function Home() { return ( HOME PAGE is here! ) } export default Home 동격 가져로기로 에러해결 2022. 4. 19.
nextjs 비주얼 스튜디오 코드 디버깅 .vscode/launch.json 파일 추가 { "version": "0.2.0", "configurations": [ { "name": "Next.js: debug server-side", "type": "node-terminal", "request": "launch", "command": "npm run dev" }, { "name": "Next.js: debug client-side", "type": "pwa-chrome", "request": "launch", "url": "http://localhost:3000" }, { "name": "Next.js: debug full stack", "type": "node-terminal", "request": "launch", "command": "np.. 2022. 4. 19.
useState 동기화 문제 export default function Test() { const [value1, setValue1] = useState(0); const [value2, setValue2] = useState(0); return ( value1 : {value1} value2 : {value2} { setValue1(prev => prev+1); setValue2(value1); }}> 계산 ) } 얼마 전에 useState를 사용하다가 난감한 상황에 빠져서 해결방법을 공유합니다. 대충 위와 같은 코드를 작성했습니다. 버튼을 클릭할 때마다 value1을 +1시 키고 value2에 대입합니다. 코드만 봤을 때는 두 값이 동시에 올라가야 합니다. 결과는... value2 값이 1 작게 설정됩니다. 이유는 SetValu.. 2022. 4. 19.
cmdline-tools component is missing 에러 해결 Android SDK Command-line Tools 설치 2022. 4. 14.
코드펜 CodePen 플러터 flutter 사용하기 코드 펜은 html, css, javascript 를 테스트하기 위한 온라인 툴 사이트입니다. 프로젝트 단위로 만들 수는 없기 때문에 간단한 코드들이 많이 업로드되어 있습니다. https://codepen.io/topic/flutter/templates 에 접속한 후에 ‘Open Flutter Editor’를 누릅니다. 코드펜 플러터 에디터가 실행됩니다. 코드를 변경하면 핫리로드 됩니다. 플러터 프로젝트를 만들면 기본으로 들어있는 카운터 소스코드를 넣어 봤습니다. 잘 동작하네요. 플러터 프로젝트 만들기 귀찮을 때 한 번씩 써먹으면 좋을 것 같습니다. 2022. 4. 13.
728x90
반응형