import { MongoClient } from "mongodb";
import 부분에 갑자기 Parsing error 발생..
👿 에러메시지
Parsing error: Cannot find module 'next/babel'
Require stack:
- E:\boot_camp\next\board\node_modules\next\dist\compiled\babel\bundle.js
- E:\boot_camp\next\board\node_modules\next\dist\compiled\babel\eslint-parser.js
- E:\boot_camp\next\board\node_modules\eslint-config-next\parser.js
- E:\boot_camp\next\board\node_modules\@eslint\eslintrc\dist\eslintrc.cjs
Make sure that all the Babel plugins and presets you are using
are defined as dependencies or devDependencies in your package.json
file. It's possible that the missing plugin is loaded by a preset
you are using that forgot to add the plugin to its dependencies: you
can workaround this problem by explicitly adding the missing package
to your top-level package.json.
다양한 해결법들이 있었는데 나의 경우에는 .eslintrc.json파일에 아래 코드를 추가해주니 해결되었다.
{
"extends": ["next/babel","next/core-web-vitals"]
}