Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Something broken between 4.0.1 and 4.2.2 #208

Closed
YuryStrozhevsky opened this issue Apr 10, 2019 · 2 comments · Fixed by #209
Closed

Something broken between 4.0.1 and 4.2.2 #208

YuryStrozhevsky opened this issue Apr 10, 2019 · 2 comments · Fixed by #209
Labels

Comments

@YuryStrozhevsky
Copy link

YuryStrozhevsky commented Apr 10, 2019

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.

YuryStrozhevsky added a commit to PeculiarVentures/PKI.js that referenced this issue Apr 10, 2019
Signed-off-by: YuryStrozhevsky <yury@strozhevsky.com>
@lukastaegert
Copy link
Member

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'] })

@lukastaegert
Copy link
Member

Fix at #209

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants