Skip to content

[ramda] Fix for TS 6.0 - #73646

Merged
typescript-bot merged 2 commits into
DefinitelyTyped:masterfrom
jakebailey:fix-ramda
Sep 10, 2025
Merged

[ramda] Fix for TS 6.0#73646
typescript-bot merged 2 commits into
DefinitelyTyped:masterfrom
jakebailey:fix-ramda

Conversation

@jakebailey

@jakebailey jakebailey commented Sep 10, 2025

Copy link
Copy Markdown
Member

Inline a type in the tests; tools.d.ts does not exist upstream and should not be in the package. (#64939 almost removed it)

Also, remove tests of the ramda/src and ramda/es imports. These do not work at runtime.

node:internal/modules/esm/resolve:313
  return new ERR_PACKAGE_PATH_NOT_EXPORTED(
         ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './es' is not defined by "exports" in /home/jabaile/work/repros/ramda-test/node_modules/ramda/package.json imported from /home/jabaile/work/repros/ramda-test/main.mjs
    at exportsNotFound (node:internal/modules/esm/resolve:313:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:661:9)
    at packageResolve (node:internal/modules/esm/resolve:774:12)
    at moduleResolve (node:internal/modules/esm/resolve:858:18)
    at defaultResolve (node:internal/modules/esm/resolve:990:11)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:749:20)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:726:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:312:38)
    at #link (node:internal/modules/esm/module_job:208:49) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v24.7.0
node:internal/modules/esm/resolve:313
  return new ERR_PACKAGE_PATH_NOT_EXPORTED(
         ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './src' is not defined by "exports" in /home/jabaile/work/repros/ramda-test/node_modules/ramda/package.json imported from /home/jabaile/work/repros/ramda-test/main.mjs
    at exportsNotFound (node:internal/modules/esm/resolve:313:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:661:9)
    at packageResolve (node:internal/modules/esm/resolve:774:12)
    at moduleResolve (node:internal/modules/esm/resolve:858:18)
    at defaultResolve (node:internal/modules/esm/resolve:990:11)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:749:20)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:726:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:312:38)
    at #link (node:internal/modules/esm/module_job:208:49) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v24.7.0

@typescript-bot

typescript-bot commented Sep 10, 2025

Copy link
Copy Markdown
Contributor

@jakebailey Thank you for submitting this PR!

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by a DT maintainer

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 73646,
  "author": "jakebailey",
  "headCommitOid": "b5952f3921a24cf04d3e2bd3c6336b9fab7f83eb",
  "mergeBaseOid": "80dffc576d90062fca5032bb48526cab4108e40b",
  "lastPushDate": "2025-09-10T19:12:46.000Z",
  "lastActivityDate": "2025-09-10T21:15:29.000Z",
  "mergeOfferDate": "2025-09-10T21:09:24.000Z",
  "mergeRequestDate": "2025-09-10T21:15:29.000Z",
  "mergeRequestUser": "jakebailey",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "ramda",
      "kind": "edit",
      "files": [
        {
          "path": "types/ramda/test/index-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/ramda/test/maxBy-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/ramda/test/minBy-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/ramda/tools.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "harris-miller",
        "Nicholaiii",
        "kedashoe",
        "adispring"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "andrewbranch",
      "date": "2025-09-10T21:08:33.000Z",
      "isMaintainer": true
    }
  ],
  "mainBotCommentID": 3276207252,
  "ciResult": "pass"
}

@typescript-bot

Copy link
Copy Markdown
Contributor

🔔 @Harris-Miller @Nicholaiii @kedashoe @adispring — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot moved this to Waiting for Code Reviews in Pull Request Status Board Sep 10, 2025
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board Sep 10, 2025
@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Sep 10, 2025
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Waiting for Author to Merge in Pull Request Status Board Sep 10, 2025
@jakebailey

Copy link
Copy Markdown
Member Author

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in Pull Request Status Board Sep 10, 2025
@typescript-bot
typescript-bot merged commit c667ec3 into DefinitelyTyped:master Sep 10, 2025
4 checks passed
@Harris-Miller

Copy link
Copy Markdown
Contributor

@jakebailey thanks for doing some future proofing for us! Question for you: What change in TS 6.0 is causing those two imports to fail at runtime?

@jakebailey

jakebailey commented Sep 11, 2025

Copy link
Copy Markdown
Member Author

microsoft/TypeScript#62320, in service of microsoft/TypeScript#62338.

Probably, this package could be changed to node16 or probably nodenext resolution at this point. I have not rerun the script to recheck those.

But, the old node10 resolution is going away, and the weird module=commonjs was changed to bundler resolution to provide some element of support, and that brings along package.json exports support.

@jakebailey
jakebailey deleted the fix-ramda branch September 11, 2025 01:57
@Harris-Miller

Copy link
Copy Markdown
Contributor

microsoft/TypeScript#62320, in service of microsoft/TypeScript#62338.

Probably, this package could be changed to node16 or nodenext resolution at this point. I have not rerun the script to recheck those.

But, the old node10 resolution is going away, and the weird module=commonjs was changed to bundler resolution to provide some element of support, and that brings along package.json exports support.

Thank you for the explanation.

I believe I found the root cause: https://github.com/ramda/ramda/blob/master/package.json#L62-L64

  "exports": {
    // full config omitted for brevity
    "./es/": "./es/",
    "./src/": "./src/",
    "./dist/": "./dist/"
  },

Those are invalid. They should explicitly point to the index.js file in each directory. Makes sense that the legacy resolvers were auto-looking for it, but no longer. I'll have to make an MR to fix

@jakebailey

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical package Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants