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

Next.js template with PNPM has a bundling problem with the AWS SDK #2800

Open
JonnyBurger opened this issue Aug 27, 2023 · 2 comments
Open

Comments

@JonnyBurger
Copy link
Member

JonnyBurger commented Aug 27, 2023

  • The Lambda function gets bundled
  • aws-crt is an optional peer dependency of the AWS SDK
  • PNPM does not install optional dependencies
  • Webpack does need every dependency that is referenced in the code, even if it does not actually get imported

/node_modules/.ppm/@AWS-SDK+util-user-agent-node@3.378.0/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-available.js Module not found: Can't resolve 'aws-crt' in "/home/ankur/Desktop/flickz/flickz/node_modules/-ppm/@AWS-SDK+util-user-agent-node@3.378.0/node_modules/@aws-sdk/util-user-agent
node/dist-cjs'
Import trace for requested module: /node modules/.ppm/@AWS-SDK+util-user-agent-node@3.378.0/node modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-available.js
./node modules/.ppm/@AWS-SDK+util-user-agent-node@3.378.0/node modules/@aws-sdk/util-user-agent -node/dist-cis/index.is ./node modules/.ppm/@AWS-SDK+client-lambda@3.382.0/node modules/@aws-sdk/client- lambda/dist-cjs/runtimeConfig.js /node modules/.ppm/@AWS-SDK+client-lambda@3.382.0/node modules/@aws-sdk/client-lambda/dist-cjs/LambdaClient.js ./ node_modules/.pnpm/@AWS-SDK+client-lambda@3.382.0/node_modules/@aws-sdk/client-lambda/dist-cjs/index.js /node modules/.ppm/@Remotion+lambda@4.0.22@Remotion+bundler@4.0.22_react-dom@18.2.0_react@18.2.0/node_modules/@emotion/lambda/dist/api/get-functions.js
./node modules/.ppm/@Remotion+lambda@4.0.22 @Remotion+bundler@4.0.22 react -dom@18.2.0 react@18.2.0/node modules/@remotion/lambda/dist/client.is
/app/api/lambda/render/route.ts

Workaround

Install aws-crt manually.

@JonnyBurger
Copy link
Member Author

We added a Next.js override to the following config:

https://github.com/remotion-dev/template-next-app-dir/blob/main/next.config.js

We recommend to add it to any Next.js router.

Still pending: Update all doc pages

@JonnyBurger
Copy link
Member Author

Or we just add it as a dependency even though it is not necessary 🤷🏼‍♂️ then no user action is needed

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

No branches or pull requests

1 participant