I have this api module from outside. When it is installed as a node_module (with npm install), then doing an import like this works:
import MyAPI from 'api'
However, when I look into the api folder in the node_modules and take out the api.js, which is entry point of the module, and do a relative import like this:
import MyAPI from './api.js'
Then I get the error:
"The requested module ./api.js does not provide an export named 'default'"
I have no control over how the api module is built. How can it work in one case but not another? This is Node 12.