React 를 사용해서 작성된 잘 동작하던 웹 응용프로그램이 아래와 같은 메시지를 출력하고, 멈춰버렸습니다.
regeneratorRuntime is not defined
v14.16.0v.7.6.3babel-plugin-transform-runtime#why 페이지에서 이유와 어떻게 해야되는지 설명하고 있습니다.
babel-plugin-transform-runtime#technical-details 페이지에서 자세한 기술적 설명을 제공합니다.
$ npm install --save-dev @babel/plugin-transform-runtime
$ npm install --save @babel/runtime
설치된 패키지 버전은 아래와 같습니다.
{
// 생략
"dependencies": {
"@babel/runtime": "^7.13.10",
// 생략
},
"devDependencies": {
"@babel/core": "^7.13.15",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
},
// 생략
}
.Babelrc 의 예제입니다.
{
// 생략
"plugins": [
[
"@babel/plugin-transform-runtime",
{
"regenerator": true
}
],
// 생략
],
// 생략
}
GitHub: cc248e6c492b6e7cc785ae48df0ecef70cc53248 커밋에서 해결된 코드를 확인하실 수 있습니다.