ncc fails to resolve imports for `es-get-iterator`

Created on 20 Mar 2020  ·  5Comments  ·  Source: vercel/ncc

Apparently, ncc has a problem with the exports declared in the package.json of es-get-iterator:

https://github.com/ljharb/es-get-iterator/blob/master/package.json#L5-L17

This package is used by the Firebase SDK and has ~1.2 million weekly installs.

It works if I manually change the main field to node.js instead and remove the exports field from the package.json.

bug priority

Most helpful comment

I have run into this issue as well.

I tried a few versions of Node, a few different module/lib targets in tsconfig, and installing es-get-iterator directly, without any luck. I can't even come up with a workaround :(

Edit: This does work for me too

It works if I manually change the main field to node.js instead and remove the exports field from the package.json.

Edit 2: Installing [email protected] works as well

All 5 comments

es-get-iterator was added as a dependency of firebase-admin with a very recent version 8.9.0. Previous versions work with ncc.

Did you find any fix for this? I am getting the same issue about Cannot find module 'es-get-iterator' while using firebase-admin.

Any idea how to get around this?

I have run into this issue as well.

I tried a few versions of Node, a few different module/lib targets in tsconfig, and installing es-get-iterator directly, without any luck. I can't even come up with a workaround :(

Edit: This does work for me too

It works if I manually change the main field to node.js instead and remove the exports field from the package.json.

Edit 2: Installing [email protected] works as well

I have run into this issue as well.

I tried a few versions of Node, a few different module/lib targets in tsconfig, and installing es-get-iterator directly, without any luck. I can't even come up with a workaround :(

Edit: This does work for me too

It works if I manually change the main field to node.js instead and remove the exports field from the package.json.

Edit 2: Installing [email protected] works as well

Tried the tip without success : https://github.com/WoodySlum/es-get-iterator/blob/master/package.json#L5

Any help ?

Thanks

If that workaround worked for some, then it might also work to change it to index.js, or `./index - of those work too, then this is a bug in how vercel resolves the “main” field.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulogdm picture paulogdm  ·  5Comments

unix picture unix  ·  5Comments

lucleray picture lucleray  ·  3Comments

benseitz picture benseitz  ·  5Comments

tmtron picture tmtron  ·  5Comments