-
Notifications
You must be signed in to change notification settings - Fork 137
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
FEATURE: Add a script to copy Polyfills to distribution folder #1292
Comments
Thanks for the thorough issue, this is great! I think you may be the first using polyfill-library in aws lambda and also as a NextJS route
I don't believe polyfill-library stores anything in |
@JakeChampion I don't think is a problem with NextJS bundling because if we build a production NextJS without Serverless it's works so maybe the problem is that but in the Serverless bundling. |
I update the README to reflect the problem with routes in AWS Lambda because this is not a library issue but it's without documentation #1291 |
Hello,
Recently, we attempted to implement an endpoint in NextJS to serve client-based polyfills. During local testing, it worked perfectly, even with the production build. However, upon deployment to the development environment, the API encountered an error indicating that it couldn't locate the polyfills.
As a result, we opened issue #1219 to address this problem. With the assistance of @JakeChampion, we were able to find a solution. To resolve the issue, we need to include the polyfills in our final bundle and modify the plugin's access path for reading the polyfills, thereby creating a package path. Consequently, I propose the following two changes:
Store the distribution polyfills in a relative path instead of /var/... to avoid potential issues in environments where that path is inaccessible (e.g., in a lambda function).Implementing these changes will greatly simplify the process of using the library when generating a bundle.
Thank you and best regards!
The framework used is NextJS and it's deployed to AWS Lambda with Serverless NextJS.
The text was updated successfully, but these errors were encountered: