
저도 아래 링크의 학생분과 비슷한 에러가 떠서 링크에 달린 답변 보고 문제는 해결했는데요
이런 문제가 발생하는 원인은 뭔가요? 새로 생성된 metro.config.js는 어떠한 기능을 하고 있는건지요?
그리고 이런 상황이 실제 개발과정에서도 흔히 발생하는 과정인가요? 보통 이런 에러들이 발생하면 현업 개발자들은 어떻게 해결하나요?
작성한 코드 및 에러 메세지
에러 메시지:
Android Bundling failed 2850ms
While trying to resolve module `idb` from file `C:\Users\leefa\OneDrive\바탕 화면\sparta-study\sparta-myhoneytip-kyoo\node_modules\@firebase\app\dist\esm\index.esm2017.js`, the package `C:\Users\leefa\OneDrive\바탕 화면\sparta-study\sparta-myhoneytip-kyoo\node_modules\idb\package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`C:\Users\leefa\OneDrive\바탕 화면\sparta-study\sparta-myhoneytip-kyoo\node_modules\idb\build\index.cjs`. Indeed, none of these files exist:
* C:\Users\leefa\OneDrive\바탕 화면\sparta-study\sparta-myhoneytip-kyoo\node_modules\idb\build\index.cjs(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
* C:\Users\leefa\OneDrive\바탕 화면\sparta-study\sparta-myhoneytip-kyoo\node_modules\idb\build\index.cjs\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
Android Bundling failed 3550ms
While trying to resolve module `idb` from file `C:\Users\leefa\OneDrive\바탕 화면\sparta-study\sparta-myhoneytip-kyoo\node_modules\@firebase\app\dist\esm\index.esm2017.js`, the package `C:\Users\leefa\OneDrive\바탕 화면\sparta-study\sparta-myhoneytip-kyoo\node_modules\idb\package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`C:\Users\leefa\OneDrive\바탕 화면\sparta-study\sparta-myhoneytip-kyoo\node_modules\idb\build\index.cjs`. Indeed, none of these files exist:
* C:\Users\leefa\OneDrive\바탕 화면\sparta-study\sparta-myhoneytip-kyoo\node_modules\idb\build\index.cjs(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
* C:\Users\leefa\OneDrive\바탕 화면\sparta-study\sparta-myhoneytip-kyoo\node_modules\idb\build\index.cjs\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
metro.config.js
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
resolver: {
sourceExts: ['jsx', 'js', 'ts', 'tsx', 'cjs', 'fs'],
},
};
