PeculiarVentures / CAdES.js

CAdESjs is an implementation of CAdES (CMS Advanced Electronic Signatures)in pure Javascript.
Other
18 stars 6 forks source link

Broken examples build #7

Closed zdravko61 closed 2 years ago

zdravko61 commented 2 years ago

Steps to reproduce:

  1. Install all dependencies - npm install
  2. Run npm run ex1

Result:

npm run ex1

cadesjs@1.0.11 ex1
cd examples/CAdESComplexExample && npm run build && cd ../..

build rollup -c && sed -f ../script.sed  es6.js > ../../test/cadesComplexExample.js

es6.js → bundle.js, ../../test/browser/cadesComplexExample.js...
(!) Circular dependencies
../../node_modules/pkijs/src/common.js -> ../../node_modules/pkijs/src/CryptoEngine.js -> ../../node_modules/pkijs/src/common.js
../../node_modules/pkijs/src/common.js -> ../../node_modules/pkijs/src/CryptoEngine.js -> ../../node_modules/pkijs/src/PublicKeyInfo.js -> ../../node_modules/pkijs/src/common.js
../../node_modules/pkijs/src/SafeContents.js -> ../../node_modules/pkijs/src/SafeBag.js -> ../../node_modules/pkijs/src/SafeContents.js
[!] Error: 'getParametersValue' is not exported by ../../node_modules/pvutils/build/utils.js, imported by ../../node_modules/asn1js/src/asn1.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
../../node_modules/asn1js/src/asn1.js (35:9)
33:  */
34: //**************************************************************************************
35: import { getParametersValue, padNumber, isEqualBuffer, bufferToHexCodes, checkBufferParams, utilToBase, utilFromBase, utilEncodeTC, utilDecodeTC, utilConcatBuf, utilConcatView } from "pvutils";
             ^
36: //**************************************************************************************
37: //region Other utility functions
Error: 'getParametersValue' is not exported by ../../node_modules/pvutils/build/utils.js, imported by ../../node_modules/asn1js/src/asn1.js
    at error (/home/zdravko/code/work/code/js-toolbox/CAdES.js/node_modules/rollup/dist/shared/rollup.js:198:30)
    at Module.error (/home/zdravko/code/work/code/js-toolbox/CAdES.js/node_modules/rollup/dist/shared/rollup.js:12477:16)
    at Module.traceVariable (/home/zdravko/code/work/code/js-toolbox/CAdES.js/node_modules/rollup/dist/shared/rollup.js:12835:29)
    at ModuleScope.findVariable (/home/zdravko/code/work/code/js-toolbox/CAdES.js/node_modules/rollup/dist/shared/rollup.js:11465:39)
    at ChildScope.findVariable (/home/zdravko/code/work/code/js-toolbox/CAdES.js/node_modules/rollup/dist/shared/rollup.js:6433:38)
    at ClassBodyScope.findVariable (/home/zdravko/code/work/code/js-toolbox/CAdES.js/node_modules/rollup/dist/shared/rollup.js:6433:38)
    at ChildScope.findVariable (/home/zdravko/code/work/code/js-toolbox/CAdES.js/node_modules/rollup/dist/shared/rollup.js:6433:38)
    at FunctionScope.findVariable (/home/zdravko/code/work/code/js-toolbox/CAdES.js/node_modules/rollup/dist/shared/rollup.js:6433:38)
    at ChildScope.findVariable (/home/zdravko/code/work/code/js-toolbox/CAdES.js/node_modules/rollup/dist/shared/rollup.js:6433:38)
    at Identifier.bind (/home/zdravko/code/work/code/js-toolbox/CAdES.js/node_modules/rollup/dist/shared/rollup.js:7724:40)

I've tried to add @rollup/plugin-commonjs to the rollup config in examples. This makes the build to pass, but handleParsingFile is not in bundle.js and the example doesn't run. Any ideas?

rmhrisk commented 2 years ago

Solved?