Skip to content

javascript.operators.import_meta - import.meta.resolve is synchronous in Node.js v20#20324

@ghost

Description

What type of issue is this?

Missing compatibility data

What information was incorrect, unhelpful, or incomplete?

import.meta.resolve in Node.js is reported as returning a Promise.

What browsers does this problem apply to, if applicable?

No response

What did you expect to see?

Since some v20.x release, import.meta.resolve in Node.js now returns synchronously.

Did you test this? If so, how?

I've not run tests.

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

The latest Node.js v19 docs report returning a Promise:

This function is asynchronous because the ES module resolver in Node.js is allowed to be asynchronous.

The current v20 docs (v20.4.0 at time of writing) report that this is now synchronous:

In alignment with browser behavior, this now returns synchronously.

History is not given in the Node.js docs. I'm not sure which specific version first made this change.

Do you have anything more you want to share?

No response

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta

MDN metadata

MDN page report details
  • Query: javascript.operators.import_meta
  • Report started: 2023-07-10T01:35:42.309Z

Metadata

Metadata

Assignees

No one assigned

    Labels

    data:jsCompat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions