Closed raxod502 closed 4 months ago
Does the code work when you run node index.js
without ncc?
It sounds like there might be a require('@octokit/plugin-throttling')
since the default is CJS which is why you're seeing the log ncc: Compiling file index.js into CJS
Since @octokit/plugin-throttling
is missing main
, then it will fail with CJS.
Yeah, it has become clear that this is not an error in ncc, because you are correct that the application code was loading the package with require
, which (despite their documentation explicitly stating the contrary) is wrong. That documentation issue is https://github.com/octokit/plugin-throttling.js/issues/677.
It would be helpful if the error message from ncc stated specifically what key it is looking at in the nested package.json
because right now the error sounds like it's saying there is no exports
entry for .
, which isn't the case. But the fact that ncc reports an error is correct.
I received the following error on trying to build someone else's abandoned project that uses ncc, after updating ncc to the latest supported version:
Note the claim that
Package path . is not exported
in@octokit/plugin-throttling
. Yet, when inspecting thepackage.json
file in the error message, it shows:This seemingly contradicts the error message.