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

AWS amplify no longer building #45

Closed
joepio opened this issue Dec 20, 2022 · 7 comments
Closed

AWS amplify no longer building #45

joepio opened this issue Dec 20, 2022 · 7 comments

Comments

@joepio
Copy link
Member

joepio commented Dec 20, 2022

I ran a migration on AWS, and since then the builds are failing. We can revert this

# if things go sideways, reset the migration
aws amplify update-app --region eu-west-2 --app-id d2f2o1bodsi4fu --platform  WEB_DYNAMIC

But I think we should try making it work with the new architecture on amplify.

joepio added a commit that referenced this issue Dec 20, 2022
@joepio
Copy link
Member Author

joepio commented Dec 20, 2022

Worked!

@joepio joepio closed this as completed Dec 20, 2022
joepio added a commit that referenced this issue Dec 20, 2022
@joepio joepio reopened this Dec 21, 2022
@joepio
Copy link
Member Author

joepio commented Dec 21, 2022

For some reason it broke again?

joepio added a commit that referenced this issue Dec 21, 2022
joepio added a commit that referenced this issue Dec 21, 2022
@joepio joepio closed this as completed Dec 21, 2022
@joepio joepio reopened this Dec 23, 2022
@joepio
Copy link
Member Author

joepio commented Dec 23, 2022

Not sure whats going on

@joepio
Copy link
Member Author

joepio commented Dec 27, 2022

2022-12-27T09:17:21.437Z [WARNING]: file:///codebuild/output/src479924625/src/home/node_modules/.pnpm/next-mdx-remote@4.2.0_biqbaboplfbrettd7655fr4n2y/node_modules/vfile-matter/index.js:11
                                    import {load} from 'js-yaml'
                                    ^^^^
                                    SyntaxError: Named export 'load' not found. The requested module 'js-yaml' is a CommonJS module, which may not support all module.exports as named exports.
                                    CommonJS modules can always be imported via the default export, for example using:
                                    import pkg from 'js-yaml';
                                    const {load} = pkg;
                                    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
                                    at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
                                    at async Promise.all (index 0)
                                    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
                                    at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
2022-12-27T09:17:21.440Z [WARNING]: 
2022-12-27T09:17:21.440Z [WARNING]: > Build error occurred
2022-12-27T09:17:21.443Z [WARNING]: Error: Failed to collect page data for /blog
                                    at /codebuild/output/src479924625/src/home/node_modules/.pnpm/next@12.3.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/build/utils.js:916:15 {
                                    type: 'Error'
                                    }
2022-12-27T09:17:21.468Z [INFO]: ELIFECYCLE  Command failed with exit code 1.
2022-12-27T09:17:21.492Z [ERROR]: !!! Build failed
2022-12-27T09:17:21.493Z [INFO]: Please check the supported SSR features to find if your build failure is related to an unsupported feature: https://docs.aws.amazon.com/amplify/latest/userguide/ssr-Amplify-support.html#supported-unsupported-features. You may also find this troubleshooting guide useful: https://docs.aws.amazon.com/amplify/latest/userguide/troubleshooting-ssr-deployment.html
2022-12-27T09:17:21.493Z [ERROR]: !!! Non-Zero Exit Code detected

We use gray-matter for markdown parsing, and that uses js-yaml, that seems like it isn't imported correctly due to some commonJS import issue. I know I've made some changes lately to NodeJS vs CommonJS module import in this project (because of errors during build), but I may have inadvertently created a new issue.

@joepio
Copy link
Member Author

joepio commented Dec 27, 2022

I think setting "type": "module" might help fix this issue, but I can't set it without failing the build.

next-i18next requires us to use CommonJS modules for its config file, so I can't use ESmodules in next.config.js.

I can rename next.config.js to next.config.cjs to allow commonJS modules, but if I do that, the locales aren't imported correctly if I run pnpm build:

rror: Invalid locale returned from getStaticPaths for /services/[pid], the locale en is not specified in next.config.js
    at /Users/joep/dev/github/ontola/home/node_modules/.pnpm/next@12.3.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/build/utils.js:661:23
    at Array.forEach (<anonymous>)
    at buildStaticPaths (/Users/joep/dev/github/ontola/home/node_modules/.pnpm/next@12.3.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/build/utils.js:615:17)
    at async /Users/joep/dev/github/ontola/home/node_modules/.pnpm/next@12.3.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/build/utils.js:886:115
    at async Span.traceAsyncFn (/Users/joep/dev/github/ontola/home/node_modules/.pnpm/next@12.3.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/trace/trace.js:79:20)

> Build error occurred

joepio added a commit that referenced this issue Jan 4, 2023
@joepio
Copy link
Member Author

joepio commented Jan 4, 2023

Vercel works just fine, though. So AWS Amplify has a weird bug in my specific configuration.

joepio added a commit that referenced this issue Jan 4, 2023
joepio added a commit that referenced this issue Jan 4, 2023
@joepio
Copy link
Member Author

joepio commented Jan 4, 2023

And netflify works, too! Since netlify has a free offering and Vercel costs 240 dollars a year, I'll stick with netlify for now.

@joepio joepio closed this as completed Jan 4, 2023
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