Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bojavou opened this issue Jul 10, 2023 · 2 comments
Labels
data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript

Comments

@bojavou
Copy link

bojavou commented Jul 10, 2023

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
@bojavou
Copy link
Author

bojavou commented Jul 10, 2023

This looks like the PR that made the change.

nodejs/node#43363

@queengooborg queengooborg added the data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript label Jul 10, 2023
@queengooborg
Copy link
Collaborator

This was fixed in #20726!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript
Projects
None yet
Development

No branches or pull requests

2 participants