Web dev/Error
-
Error / gulp server CSP errorWeb dev/Error 2023. 6. 25. 16:32
회사에서는 gulp를 쓰고 있다. 근데 갑자기 아래와 같은 에러가 발생하면서 스크립트를 수정하면 적용되지 않았다. Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-g+j6GGgaPxpY5NBSgWFCJYMgEBGipeao9g4UR6+wsmw='), or a nonce ('nonce-...') is required to enable inline execution. 신기한게 이미 빌드가 되어있어서 그런가 기존 스크립트적용된건 잘 작동했는데 수정하면..
-
Error / node.js server start errorWeb dev/Error 2023. 3. 10. 16:49
express로 서버를 만들고 server를 돌렸을때 아래와 같은 에러가 발생했다. [0] Error: listen EADDRINUSE: address already in use :::5000 [0] at Server.setupListenHandle [as _listen2] (node:net:1432:16) [0] at listenInCluster (node:net:1480:12) [0] at Server.listen (node:net:1568:7) [0] at Function.listen (/Users/yanghong-yeol/Desktop/Jart-test/Jart/node_modules/express/lib/application.js:635:24) [0] at Object. (/Users/yangh..
-
Error / mysql connection-Pool DB연결 끊김 timeoutWeb dev/Error 2022. 5. 7. 23:12
express로 서버를 구현하였다. AWS RDS로 디비를 구축하여 mysql로 연결을 하였는데 자꾸 끊김현상이 발생되었다. mysql은 오랜시간 사용하지 않으면 자동으로 끊기게 된다. 검색해보면 timeout설정을 바꾸라고 하던데 설정을 바꾸지 않고 connection-Pool을 사용하면된다. 커넥션풀은 WAS가 실행되면 DB에 바로연결하지 않고 중간에서 커넥션풀이 커넥션을 빌려주고 반납받아 DB에 연결과부하가 되지 않도록 관리 해준다. 설정으로 커넥션수도 제한할 수 있다. db.js const dotenv = require('dotenv'); dotenv.config(); const mysql = require("mysql"); const pool = mysql.createPool({ host: pr..
-
Error / React / Uncaught TypeError: Cannot read properties of null (reading 'map') 문제해결 / aixos 데이터 렌더링Web dev/Error 2022. 4. 14. 23:59
리엑트로 퍼블리싱중이다. json-server로 api를 만들어서 불러와 슬라이드를 만들고 있었다. 데이터를 잘 받아와서 map()함수로 데이터를 뿌려주려고 했는데 에러가 났다.. Uncaught TypeError: Cannot read properties of null (reading 'map') 검색을 해보니 이러한 에러가 발생한 이유는 React 는 렌더링이 화면에 커밋 된 후에야 모든 효과를 실행하기 때문이다. 즉 React는 return에서map()을 반복실행할 때 첫 턴에 데이터가 아직 안들어와도 렌더링이 실행되며 당연히 그 데이터는 undefined로 정의되어 오류가 나는 것이다. 문제해결은 &&을 넣어준다. {car && car.map((car) => ( {car.name} ))} 조건이 ..
-
Error / React-Dom.render 에러 / react-dom.development.js:86 Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more:Web dev/Error 2022. 4. 11. 16:32
깃헙페이지 때문에 테스트겸 새로 CRA로 리엑트 프로젝트를 만들었는데 이러한 에러메시지가 떴다. 이유는 리엑트 18부터는 조금 다르게 쓴다. 'react-dom.development.js:86 Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more:' 1. /src/index.js를 수정해주면된다. 2.import { createRoot } from 'react-dom/client'; 를 불러와 root에 담아 준다. 3.React.DOM이 아..
-
Error / React getElementByClassName() / Uncaught TypeError: Cannot read properties of undefined (reading 'add') 해결Web dev/Error 2022. 3. 30. 18:48
리엑트로 퍼블리싱중 .. Aside를 구현하는 중 버튼을 누르면 클래스를 주려했다. 처음엔 이렇게 구현을 했다. const handleAide = (e) =>{ const asideWrap = document.getElementsByClassName(aside.aside_wrap); const deemed = document.getElementsByClassName(aside.deemed); console.log(asideWrap) document.body.classList.add(aside.stop) asideWrap.classList.add(aside.aside_actve) deemed.classList.add(aside.on) } 'Uncaught TypeError: Cannot read prope..