Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

fix: compile away node:-namespaced imports #806

Merged
merged 8 commits into from
Nov 12, 2021

Conversation

netlify-team-account-1
Copy link
Contributor

@netlify-team-account-1 netlify-team-account-1 commented Nov 12, 2021

- Summary

AWS Lambda currently ships v14.17.4. Some libraries start using require("node:..."), which was only added in v14.18. This PR updates our esbuild bundler, so that it "compiles away" the node: prefix. The legacy / NFT logic behaviour is untouched.

cc https://github.com/netlify/pod-serverless/issues/57

cc nuxt/nuxt#12764

- Test plan

- A picture of a cute animal (not mandatory but encouraged)

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Nov 12, 2021
eduardoboucas
eduardoboucas previously approved these changes Nov 12, 2021
Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can you change the description so that this doesn't close https://github.com/netlify/pod-serverless/issues/57? The issue is still there when not using esbuild.

@netlify-team-account-1 netlify-team-account-1 merged commit ed26237 into main Nov 12, 2021
@netlify-team-account-1 netlify-team-account-1 deleted the remove-node-prefix branch November 12, 2021 14:31
Skn0tt pushed a commit that referenced this pull request Nov 15, 2021
this test was added as a very specific reproduction case, but since
was superceded by two more general tests.
Removed in a follow-up to #806.
kodiakhq bot pushed a commit that referenced this pull request Nov 15, 2021
this test was added as a very specific reproduction case, but since
was superceded by two more general tests.
Removed in a follow-up to #806.

Co-authored-by: Netlify Team Account 1 <netlify-team-account-1@users.noreply.github.com>
Skn0tt pushed a commit to netlify/build that referenced this pull request May 21, 2024
…-it#806)

* chore: reproduce problem

* fix: rewrite node:-imports on esbuild

* chore: only require esbuild-compiled bundles

* chore: require file for Node >= 14.18

* chore: gte wants a version, not an expression

* chore: i should really run tests locally

* chore: add test for cjs files, describe better

* Update main.js

Co-authored-by: Netlify Team Account 1 <netlify-team-account-1@users.noreply.github.com>
Skn0tt pushed a commit to netlify/build that referenced this pull request May 21, 2024
this test was added as a very specific reproduction case, but since
was superceded by two more general tests.
Removed in a follow-up to netlify/zip-it-and-ship-it#806.

Co-authored-by: Netlify Team Account 1 <netlify-team-account-1@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants