Skip to content

Native Temporal in Node 26 is not supported #767

@Darkhogg

Description

@Darkhogg

As of Node.js 26.0.0, Temporal is natively supported with no flags, and so I proceeded to remove the polyfill from my server, only to find this error:

TypeError: The published must be of type Temporal.Instant.
    at new Object$1 (file://.../node_modules/.pnpm/@fedify+vocab@2.2.1/node_modules/@fedify/vocab/dist/mod.js:235:14)
    at new Article (file://.../node_modules/.pnpm/@fedify+vocab@2.2.1/node_modules/@fedify/vocab/dist/mod.js:19395:3)
    ...
    at async file://.../node_modules/.pnpm/@fedify+fedify@2.2.1/node_modules/@fedify/fedify/dist/middleware-huKeo4t5.js:1210:18
    at async handleCollection (file://.../node_modules/.pnpm/@fedify+fedify@2.2.1/node_modules/@fedify/fedify/dist/middleware-huKeo4t5.js:1201:26)

(stack trace slightly redacted, but the important bits are there)

Re-introducing the polyfill fixes the issue, so it seems like an issue of only detecting the polyfill Instant class instead and not the native one.


As an extra problem, using the native Temporal without importing the polyfill (even if, as I'm doing, you monkey-patch the global Temporal with the polyfill) makes it Typescript complains about the types being wrong, because it expects a polyfilled Instant but it's getting the native one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions