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

Hosting Next.js web in Yarn Workspace Monorepo was Failed. #3797

Open
5 tasks done
jiyaaany opened this issue Nov 10, 2023 · 4 comments
Open
5 tasks done

Hosting Next.js web in Yarn Workspace Monorepo was Failed. #3797

jiyaaany opened this issue Nov 10, 2023 · 4 comments

Comments

@jiyaaany
Copy link

Before opening, please confirm:

  • I have checked to see if my question is addressed in the FAQ.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

App Id

d1c90c3mxyn376

AWS Region

ap-northeast-2

Amplify Hosting feature

Monorepo, SSR

Frontend framework

Next.js

Next.js version

13

Next.js router

Pages Router

Describe the bug

First, My project architecture like below

project-root
  packages
    nextjs-web
      .next // build output
    ...apps

I set up deploying next.js web through Amplify but it failed at second step (provisioning > build)

Expected behavior

Build Success

Reproduction steps

스크린샷 2023-11-10 오후 5 16 07

Build Settings

version: 1
applications:
  - frontend:
      phases:
        preBuild:
          commands:
            - yarn install
        build:
          commands:
            - yarn web build # web is alias of nextjs-web package
      artifacts:
        baseDirectory: packages/nextjs-web/.next
        files:
          - '**/*'
      cache:
        paths:
          - .yarn/**/*
      buildPath: /
    appRoot: packages/nextjs-web
    customHeaders:
    - pattern: /
    headers:
      - key: Cache-Control
        value: s-maxage=10

Log output

# Put your logs below this line
2023-11-10T08:05:40.632Z [INFO]: Found customHttp.yml, applying custom headers...
2023-11-10T08:05:40.710Z [ERROR]: !!! CustomerError: Cannot find package: next. Please ensure the dependency is installed correctly

Additional information

I think It looks like it's all over by build. But I don't know what makes it fail after the build.

@mo-fouad
Copy link

I have the same Issue,
@jiyaaany Have you managed to solve it yet ?

@jiyaaany
Copy link
Author

@mo-fouad No. Not yet. 😂

@mo-fouad
Copy link

@jiyaaany, Well, After a lot of debugging, I dropped Yarn on Amplify, and kept it only on local dev, And used only NPM.

@BearHumanS
Copy link

@jiyaaany, 혹시 이 문제 해결 하셨나요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants