next.js 강의를 듣는 중...
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
// 생략
<ReactMarkdown remarkPlugins={[remarkGfm]}>
{content}
</ReactMarkdown>
remarkPlugins 이 부분에서 오류가 발생함.
// 페이지
Unhandled Runtime ErrorError: Cannot read properties of undefined (reading 'inTable')
// node
- error node_modules\mdast-util-gfm-table\lib\index.js (123:0) @ Object.exitCodeText
- error TypeError: Cannot read properties of undefined (reading 'inTable')
=> 해결
강의의 remark-gfm 버전과 달라서 생긴 문제. package.json에서 버전 낮춤.
// 변경 전
"remark-gfm": "^4.0.0",
// 변경 후
"remark-gfm": "^3.0.1",
+ 아래 오류는 next.config.js를 수정해야 함.
Unhandled Runtime Error
Error: Invalid src prop (https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80) on `next/image`, hostname "images.unsplash.com" is not configured under images in your `next.config.js` See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true,
},
images: {
domains: ["images.unsplash.com"],
},
};
module.exports = nextConfig;
'문제 발생 및 해결' 카테고리의 다른 글
react-pdf (0) | 2023.05.19 |
---|---|
오류 발생 : Module not found: Error: Can't resolve 'zlib' in (0) | 2022.08.12 |
git pull 에러 : cannot open git-upload-pack (0) | 2021.06.26 |
추가 필요 / autocomplete off not working (0) | 2021.05.13 |
공공데이터 포털 api 사용 - 한글 깨짐 (1) | 2021.05.13 |