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

Wrong host (default domain URL) in Next JS application #3686

Closed
5 tasks done
santafoo-aarini opened this issue Sep 5, 2023 · 3 comments
Closed
5 tasks done

Wrong host (default domain URL) in Next JS application #3686

santafoo-aarini opened this issue Sep 5, 2023 · 3 comments
Labels
archived This issue has been locked. closed-for-staleness compute question Further information is requested response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@santafoo-aarini
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

d3jc37kz92edxo

AWS Region

eu-west-3

Amplify Hosting feature

Deployments, Frontend builds

Frontend framework

Next.js

Next.js version

13.4.19

Next.js router

App Router

Describe the bug

The Next JS application displays the following url as the app base url:
https://prod.eu-west-3.gateway.amplify.aws.dev

Instead, the correct value should be:
https://dev.d3jc37kz92edxo.amplifyapp.com/

Expected behavior

The correct value of the Next JS application base URL should be:
https://dev.d3jc37kz92edxo.amplifyapp.com/

Reproduction steps

  1. Clone https://github.com/saleor/saleor-app-payment-stripe
  2. Add the amplify.yml with the following code:
version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm install -g pnpm
        - pnpm install
    build:
      commands:
        - env | grep -e SECRET_KEY >> .env.production
        - env | grep -e APP_DEBUG >> .env.production
        - npm run build
  artifacts:
    baseDirectory: .next
    files:
      - "**/*"
  # cache:
  #   paths:
  #     - node_modules/**/*
  #     - .next/cache/**/*
  1. Deploy the app with Amplify
  2. Go to the app's default domain URL navigate to the path /api/manifest, (e.g. https://branch.app_id.amplifyapp.com/api/manifest)
  3. Check the property "appUrl" ... it should read the default app url, instead it reads https://prod.eu-west-3.gateway.amplify.aws.dev

Build Settings

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm install -g pnpm
        - pnpm install
    build:
      commands:
        - env | grep -e SECRET_KEY >> .env.production
        - env | grep -e APP_DEBUG >> .env.production
        - npm run build
  artifacts:
    baseDirectory: .next
    files:
      - "**/*"
  # cache:
  #   paths:
  #     - node_modules/**/*
  #     - .next/cache/**/*

Log output

# Put your logs below this line


Additional information

No response

@santafoo-aarini santafoo-aarini changed the title Wrong default domain URL in Next JS application Wrong host (default domain URL) in Next JS application Sep 5, 2023
@Jay2113
Copy link
Contributor

Jay2113 commented Feb 13, 2024

Hi @santafoo-aarini 👋 , thanks for reaching out. While reviewing the api/manifest route for your Amplify app, I observed that the expected appUrl attribute is being returned "appUrl":"https://dev.d3jc37kz92edxo.amplifyapp.com".

Based on the manifest file, it seems that the appBaseUrl key is contained within the context object that is returned by Next.js: https://github.com/saleor/saleor-app-payment-stripe/blob/canary/src/pages/api/manifest.ts#L19

Are you still observing an unexpected behavior?

@Jay2113 Jay2113 added question Further information is requested compute response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed pending-triage labels Feb 13, 2024
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Feb 16, 2024
Copy link

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Feb 20, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. closed-for-staleness compute question Further information is requested response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants