6. Error / / 2024. 9. 4. 16:30

[ ActiveReportsJs ] PDF 다운로드 구현과정 모듈 에러문제

728x90

구현하고자 했던 기능 

Report를 PDF로 다운로드 하는 기능

문제

https://demo.mescius.co.kr/activereportsjs/docs/DeveloperGuide/api/printing-and-exporting-the-report-output

 

ActiveReportsJS: 소개

 

demo.mescius.co.kr

공식문서를 참고하여 PDF 다운로드 버튼 구현하는 과정에서 모듈 에러문제가 발생했다
모듈 에러는 정말 난감한게....내가 잘못한거없고ㅠ 내부적 문제로 하나하나 찾아봐야한다는 점이다

에러 문구

ERROR in ./src/components/Report/pdfUtils.ts 19:23-38
export 'Core' (imported as 'Core') was not found in '@mescius/activereportsjs' (module has no exports)
ERROR in ./src/components/Report/pdfUtils.ts 26:25-49
export 'PdfExport' (imported as 'PdfExport') was not found in '@mescius/activereportsjs' (module has no exports)
ERROR in ./node_modules/@mescius/activereportsjs/lib/index.js 1:0-65
Module not found: Error: Can't resolve './node_modules/@mescius/ar-js-pagereport' in '/Users/imhyeonjeong/Desktop/ANASA-WARE-FRONT-REACT/node_modules/@mescius/activereportsjs/lib'
Did you mean 'ar-js-pagereport.js'?
BREAKING CHANGE: The request './node_modules/@mescius/ar-js-pagereport' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
ERROR in ./node_modules/@mescius/activereportsjs/lib/index.js 2:0-69
Module not found: Error: Can't resolve './node_modules/@mescius/ar-js-viewer' in '/Users/imhyeonjeong/Desktop/ANASA-WARE-FRONT-REACT/node_modules/@mescius/activereportsjs/lib'
Did you mean 'ar-js-viewer.js'?
BREAKING CHANGE: The request './node_modules/@mescius/ar-js-viewer' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

 

해결 방법

  • (전) import { PdfExport, HtmlExport, TabularDataExport } from '@mescius/activereports';
  • (후) import { PdfExport, HtmlExport, TabularDataExport } from '@grapecity/activereports';
  • 이렇게 바꿨더니 잘 불러와지고 에러가 안남

 

왜인지 모르겠지만....아무튼 해결되어서 좋다

  • 네이버 블로그 공유
  • 네이버 밴드 공유
  • 페이스북 공유
  • 카카오스토리 공유