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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

use esm dynamic imports for latest-version and update-notifier #2475

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

niclim
Copy link
Contributor

@niclim niclim commented Oct 31, 2023

馃崡 Description

What does this PR do? Anything folks should know?

unreverts #2465

the reason this was failing is because babel was transpiling dynamic imports (await import()) into require() which throws the error Error [ERR_REQUIRE_ESM]: require() of ES Module. Excluding { exclude: ['proposal-dynamic-import'] } fixes this

Created a prerelease 0.50.17-0 to test this out - to test:
With binary distr

  • Can run cli (hits the update notifier path) - broken - need to investigate
    • errors: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'update-notifier' ... Did you mean to import update-notifier/index.js?
    • const updateNotifier = (await import('update-notifier/index.js')).default; TypeError: Invalid host defined options
  • Sanity check ruleset upload / import (there was weird things with our import handling with custom ruleset uploads that i want to double check)

With npm package

  • Can run cli (hits the update notifier path)
  • Sanity check ruleset upload / import (there was weird things with our import handling with custom ruleset uploads that i want to double check)

馃摎 References

Links to relevant docs (Notion, Twist, GH issues, etc.), if applicable.

馃懝 QA

How can other humans verify that this PR is correct?

@niclim niclim changed the title use esm dynamic imports use esm dynamic imports for latest-version and update-notifier Oct 31, 2023
@niclim niclim marked this pull request as draft October 31, 2023 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant