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

esbuild not working in prod serverless functions #33294

Closed
brynshanahan opened this issue Jan 14, 2022 · 3 comments · Fixed by #33548
Closed

esbuild not working in prod serverless functions #33294

brynshanahan opened this issue Jan 14, 2022 · 3 comments · Fixed by #33548
Labels
bug Issue was opened via the bug report template.

Comments

@brynshanahan
Copy link

Run next info (available from version 12.0.8 and up)

Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64
Binaries:
Node: 15.10.0
npm: 7.5.3
Yarn: 1.22.11
pnpm: 5.4.0
Relevant packages:
next: 12.0.8
react: 17.0.2
react-dom: 17.0.2

What version of Next.js are you using?

12.0.8

What version of Node.js are you using?

15.10.0

What browser are you using?

Edge

What operating system are you using?

macOS

How are you deploying your application?

Vercel

Describe the Bug

importing esbuild in serverless functions doesn't work in production (but does locally)

Expected Behavior

You should be able to import and use esbuild in API functions without any special configuration

To Reproduce

Reproduction repo. https://github.com/brynshanahan/esbuild-repro

https://esbuild-repro.vercel.app/

Esbuild is being used to compile the code at the top of this page in getStaticProps successfully and the button calls the API endpoint (that runs the exact same code as the getStaticProps function)

@brynshanahan brynshanahan added the bug Issue was opened via the bug report template. label Jan 14, 2022
@brynshanahan
Copy link
Author

I tried manually adding all node_modules/esbuild- files to my functions .nft.json after build but that didn't work either

@balazsorban44
Copy link
Member

Please refer to vercel/nft#246

kodiakhq bot pushed a commit that referenced this issue Jan 22, 2022
- Fixes #33294

Co-authored-by: JJ Kasper <[email protected]>
natew pushed a commit to natew/next.js that referenced this issue Feb 16, 2022
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants