ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • nestjs에서 multer, multer-s3, aws-sdk/client-s3로 멀티 업로드
    Nest.js 2023. 10. 5. 21:11
    728x90
    $ npm i aws-sdk/client-s3
    $ npm i multer 
    $ npm i multer-s3 
    
    $ npm i @types/multer-s3 --save-dev

     

    진짜 4시간 걸린 삽질 끝에 성공 했는데 하면서 발생했던 치명적 에러

    TypeError: (0 , multers3.default) is not a function

    나를 괴롭혔던 에러

         | /app/src/common/builders/multer.builder.ts:60
         |                    contentType: multerS3.AUTO_CONTENT_TYPE,
         |                          ^
        | TypeError: Cannot read properties of undefined (reading 'AUTO_CONTENT_TYPE')
         |     at MulterBuilder.build (/app/src/common/builders/multer.builder.ts:60:26)
         |     at CreateBodyImageMulterOptions (/app/src/utils/upload-media.ts:34:5)
         |     at Object.<anonymous> (/app/src/api/feeds/feeds.controller.ts:32:61)
         |     at Module._compile (node:internal/modules/cjs/loader:1256:14)
        |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
        |     at Module.load (node:internal/modules/cjs/loader:1119:32)
         |     at Function.Module._load (node:internal/modules/cjs/loader:960:12)
         |     at Module.require (node:internal/modules/cjs/loader:1143:19)

    //ts.config
    {
    	"compilerOptions": {
        
    		....
            
    		"esModuleInterop": true, // 추가
            
            ...
    		
    	}
    }

    해당 추가로 해결했다... 

    728x90
Designed by Tistory.