SMALL
// next.config.js
const nextConfig = {
reactStrictMode: true,
async headers() {
return [
{
// matching all API routes
source: "/api/:path*",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: "*" },
{
key: "Access-Control-Allow-Methods",
value: "GET,OPTIONS,PATCH,DELETE,POST,PUT",
},
{
key: "Access-Control-Allow-Headers",
value:
"X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version",
},
],
},
];
},
webpack(config, options) {
config.module.rules.push({
test: /\.svg$/,
issuer: { and: [/\.(js|ts)x?$/] },
use: ["@svgr/webpack"],
});
return config;
},
};
module.exports = nextConfig;
[kakao map] vercel로 배포하였을때 발생하는 CORS 오류 해결하는 법
local에서 개발할때는 kakao map 지도가 잘 보였는데vercel에서 배포를 하니까 이렇게 뜨면서 지도가 전혀 뜨지 않는 오류가 발생했었다.이전에도 지금 상황처럼 똑같이 next.js로 개발하고 kakao map 지
velog.io
LIST
'일반' 카테고리의 다른 글
next.js 언어모듈 참고 (0) | 2024.01.18 |
---|---|
npm Cannot read properties of undefined (reading 'stdin') error (0) | 2024.01.17 |
kakaomap 연동하기 (0) | 2024.01.15 |
NextAuth로 구글로그인 구현하기 (0) | 2024.01.09 |
트랜잭션(Transaction)의 개념과 사용법 (0) | 2024.01.09 |