๊ฐœ๋ฐœ/โŒ ์˜ค๋ฅ˜ ๋…ธํŠธ

[React / Firebase ] Attempted Import Error: ‘Firebase’ Does Not Container A Default Export ~ ์˜ค๋ฅ˜ ํ•ด๊ฒฐํ•˜๊ธฐ!

๋ฐ(Ming) ๐Ÿˆ‍โฌ› 2022. 2. 17. 23:49
728x90
๋ฐ˜์‘ํ˜•

๋„ทํ”Œ๋ฆญ์Šค ์•ฑ ํด๋ก ์ฝ”๋”ฉ์„ ํ•˜๋ฉด์„œ ๋„ทํ”Œ๋ฆญ์Šค ์•ฑ์— ๋“ค์–ด๊ฐˆ ์ปจํ…์ธ  ์—…๋กœ๋“œ์™€ ์‚ญ์ œ ๋“ฑ์„ ํ•˜๊ธฐ ์œ„ํ•ด์„œ ํŒŒ์ด์–ด๋ฒ ์ด์Šค๋ฅผ ์—ฐ๊ฒฐ์‹œ์ผฐ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ์•„๋ฌด๋ฆฌ import์„ ํ•ด๋„ ์—ฐ๊ฒฐ์ด ์•ˆ๋˜๋Š” ๊ฒƒ์ด๋‹ค ใ… ใ… ใ… 
์•„๋ฌด๋ฆฌ ๊ตฌ๊ธ€๋ง์„ ํ•ด๋„ ๋‹ค๋“ค npm install firebase๋งŒ ์–˜๊ธฐํ•˜๊ณ  ์‹ฌ์ง€์–ด ํ•ด๋ดค์ง€๋งŒ ์†Œ์šฉ์—†์—ˆ๋‹ค.
๊ฑฐ์˜ 1-2์‹œ๊ฐ„๋™์•ˆ ๋ฏธ์นœ๋“ฏ์ด ๊ตฌ๊ธ€๋ง์„ ํ•ด์„œ ์ฐพ์•„๋ƒˆ๋‹ค!!! ํ•ด๊ฒฐ๋ฐฉ์•ˆ!!

 

With version 9 things changed a bit for importing firebase, but there is no need to downgrade to a previous version, there is a “compatibility” option so can use the /compat folder in your imports, like this

ํ˜„์žฌ firebase v9 ๋Š” import ํ•˜๋Š” ๋ฐฉ์‹์ด ์‚ด์ง ๋‹ฌ๋ผ์กŒ๋‹ค๊ณ  ํ•œ๋‹ค. ์ด์ „์˜ ๋ฐฉ๋ฒ•์„ ์“ฐ๋ ค๋ฉด ๋‹ค์šด๊ทธ๋ ˆ์ด๋“œํ•œ ๋ฒ„์ ผ์„ ๋‹ค์šด๋ฐ›์•„ํ•œ๋‹ค๊ณ ……

์ด์ „์—๋Š” ๊ทธ๋ƒฅ

 

impot firebase from ‘firebase/app’;

 

ํ•˜๋ฉด ๊ฐ€๋Šฅํ–ˆ๋Š”๋ฐ ์ด์ œ๋Š” ํด๋” ์‚ฌ์ด์— compat์„ ๋„ฃ์–ด์ค˜์•ผํ•œ๋‹ค๊ณ ํ•œ๋‹ค

๋ฐ”๋กœ ํ•ด๊ฒฐ๋จ !!!!!!!!!

 

๐Ÿ‘‰๐Ÿป stackoverflow์—์„œ ์ฐพ์•„๋‚ธ ํ•ด๊ฒฐ๋ฐฉ์•ˆ

https://stackoverflow.com/questions/68946446/how-do-i-fix-a-firebase-9-0-import-error-attempted-import-error-firebase-app

 

How do I fix a Firebase 9.0 import error? "Attempted import error: 'firebase/app' does not contain a default export (imported as

I am trying to implement firebase in my React application but it seems my version of importing is outdated. Here is my code: import firebase from "firebase/app"; import "firebase/aut...

stackoverflow.com

 

 

 

 

728x90