Something broken between 4.0.1 and 4.2.2
YuryStrozhevsky opened this issue · 2 comments
I have a PKI.js which I am supporting. In the package I introduced very intensive usage of rollup
and rollup-plugin-node-resolve
. In the package.json
I stated "rollup-plugin-node-resolve": "latest"
but seems I have a problem because of it.
So, the PKI.js has a set of examples which are written using ES6 modules. In order to use them inside browsers or Node.js I require to build them using rollup
. And all was fine - on my development machine I had version 4.0.1 of rollup-plugin-node-resolve
and had no troubles. But today one of the users reported me that on clean installation he could not run examples. I have inspected the issue and came to conclution - something broken between 4.0.1 and 4.2.2 versions of rollup-plugin-node-resolve
. You could check it by this set of commands:
git clone https://github.com/PeculiarVentures/PKI.js.git
cd PKI.js
npm i
npm run build
npm run ex1
When I am using version 4.0.1 there no problems, when I am using 4.2.2 I have a bunch of errors like:
../../src/OtherPrimeInfo.js
Sequence is not exported by ../../node_modules/asn1js/build/asn1.js
142: {
143: //region Construct and return new ASN.1 schema for this object
144: return (new asn1js.Sequence({
^
145: value: [
146: this.prime.convertToDER(),
All these error messages came from just one module (which is also mine, btw) - ASN1.js. I made an experiments - I have the problem when I am switching to latest
for rollup-plugin-node-resolve
only.
Thanks for posting this! I believe there is a typo in the handling of jsnext:main
. In the meantime until I find a moment to fix it, you can avoid the issue by switching to the new mainFields
option in your rollup config:
rollupNodeResolve({ jsnext: true, main: true })
becomes
rollupNodeResolve({ mainFields: ['jsnext:main', 'main'] })
Fix at #209