Ask questionsnode v13.0-v13.1 errors on require of a module with "exports" defined

I get this error: Error: Package exports for 'path/to/package' do not define a valid '.' target

when, in the node v13.1 repl (where the flag should be required), I have:

     "main": "index",
     "exports": {
         ".": {
             "default": "./node.js"

I would have expected "exports" to have no effect prior to v13.2 when no modules flag is provided. It throws for me on v13.0 and v13.1, although not on v12.

This seems like a pretty serious back compat issue.


Answer questions MylesBorins

Tbh I don't think that is something we should care about. Yes we should ensure the changes we make are not semver major, but this is an experimental feature and those are unsupported releases at this point

On Mon, Nov 25, 2019, 2:08 PM Jordan Harband wrote:

No issues I can find with v12.

I don't mean, a back compat issue that we could fix in older v13 minors (altho that would be ideal), i mean an issue with keeping "exports" moving forward, because it means any package that uses the object form can never work on those two minors of node.

Is there any version of the object form that will work on v13.0 and v13.1?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe .


Related questions

No questions were found.
Myles Borins MylesBorins @GitHub Toronto Artist, musician, developer, and maker / OSS Product Management @github / @nodejs TSC / @tc39 Delegate
Github User Rank List