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

revert to using cjs for lambda #4967

Merged
merged 1 commit into from
May 21, 2022
Merged

revert to using cjs for lambda #4967

merged 1 commit into from
May 21, 2022

Conversation

Rich-Harris
Copy link
Member

fixes #4933. I don't truly understand why this was failing, but reverting to cjs rather than esm seems to fix it. If it turns out that other apps need esm then we can expose it as a config option

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

@changeset-bot
Copy link

changeset-bot bot commented May 17, 2022

🦋 Changeset detected

Latest commit: 7884c0e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/adapter-vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Rich-Harris Rich-Harris marked this pull request as ready for review May 17, 2022 15:09
@Rich-Harris
Copy link
Member Author

Ah, wait. The switch to esm wasn't a generic modernisation, it was to enable top-level await. I guess we do need the option.

I also wonder if we can skip the esbuild step for lambdas by using @vercel/nft to include the necessary node_modules rather than bundling them into a single file — it's possible that we could then have our cake and eat it.

@benmccann
Copy link
Member

Vite is considering only supporting ESM output for 3.0. It'd be nice if we could make that work

@Rich-Harris
Copy link
Member Author

Vite isn't involved in this part at all

@benmccann benmccann added the pkg:adapter-vercel Pertaining to the Vercel adapter label May 17, 2022
@furudean
Copy link
Contributor

Can we merge this now in favor of unblocking some folk seeing as #4969 might take some time?

@Rich-Harris Rich-Harris merged commit a452bd8 into master May 21, 2022
@Rich-Harris Rich-Harris deleted the gh-4933 branch May 21, 2022 12:34
@Rich-Harris
Copy link
Member Author

yep, i was hoping the nft version would work, but there are some lingering issues to work out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:adapter-vercel Pertaining to the Vercel adapter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@sveltejs/adapter-vercel 1.0.0-next.51 breaks production project
3 participants