728x90
구현하고자 했던 기능
Report를 PDF로 다운로드 하는 기능
문제
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';
- 이렇게 바꿨더니 잘 불러와지고 에러가 안남
왜인지 모르겠지만....아무튼 해결되어서 좋다
'6. Error' 카테고리의 다른 글
[ ActiveReportJs ] PDF파일로 저장시, 한글 폰트 깨지는 문제 (1) | 2024.09.09 |
---|---|
[ ActiveReportsJs ] PDF 다운로드 구현과정 getDocument 매서드 문제 (1) | 2024.09.04 |
[ Active Reports JS ] React내에서 렌더링 안되는 404 에러 (0) | 2024.09.02 |
[eslint] is defined but never used (0) | 2024.06.13 |
[CORS] The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute. (0) | 2024.05.30 |