aws-amplify / aws-amplify/amplify-hosting
Error: Cannot find module '@swc/helpers/lib/_async_to_generator.js'
- Dominant language
- Dockerfile
- Stars
- 481
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
### Before opening, please confirm:
- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
### App Id
d1luczyjzxi40j
### AWS Region
us-east-2
### Amplify Hosting feature
Frontend builds
### Describe the bug
Scenario 1:
1. Start to host a Nextjs 12 app (appID: d1luczyjzxi40j)
2. When the build is done, to do domain
3. Got 500 errors from CloudFront

4. Cloudwatch logged error
> Error: Cannot find module '@swc/helpers/lib/_async_to_generator.js'
5. Ping `@swc/helpers` version to `0.4.14`
6. Issue persists.
Scenario 2:
If I start with a Nextjs 11 app, the issue can be fixed.
1. Start to host a Nextjs 11 app (appID: d3sci3ahfz8hus, appID: d2213k35dz5phy)
2. Migrate to Nextjs12
3. Same as Scenario 1, 2-4.
4. Ping `@swc/helpers` version to `0.4.14`
5. The issue is resolved
Scenario 2 is not reproducable.
### Expected behavior
Nextjs 12 app should should up without 5xx errors or `Error: Cannot find module '@swc/helpers/lib/_async_to_generator.js' `.
### Reproduction steps
Nextjs 12 app got 5xx errors with the following error in CloudWatch...
> Error: Cannot find module '@swc/helpers/lib/_async_to_generator.js'
### Build Settings
_No response_
### Log output
```
# Put your logs below this line
```
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.