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

getDnsSuffix Webpack Error On Build #13253

Open
3 tasks done
steffen-tomm opened this issue Apr 16, 2024 · 7 comments
Open
3 tasks done

getDnsSuffix Webpack Error On Build #13253

steffen-tomm opened this issue Apr 16, 2024 · 7 comments
Assignees
Labels
dependencies Pull requests that update a dependency file Next.js question General question

Comments

@steffen-tomm
Copy link

steffen-tomm commented Apr 16, 2024

Before opening, please confirm:

JavaScript Framework

Next.js

Amplify APIs

Not applicable

Amplify Version

v6

Amplify Categories

Not applicable

Backend

Other

Environment information

# Put output below this line


Describe the bug

i have the following bug and i have no idea how to solve it. Google doesn't help me anymore. Someone any idea?

The failure is that when i try
npm run build

it responsens:

Failed to compile.

./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithRedirect.mjs + 47 modules
Cannot get final name for export 'getDnsSuffix' of ./node_modules/@aws-amplify/core/dist/esm/clients/index.mjs

Build failed because of webpack errors

Expected behavior

it should create the build, but doesn't

Reproduction steps

npm run build

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

import {type ResourcesConfig} from 'aws-amplify';

export const authConfig: ResourcesConfig['Auth'] = {
    Cognito: {
        userPoolId: 'eu-central-1_SSt3fgGcD',
        userPoolClientId: '5sdfs8fsafdsdvdsafsq2gphi5dsfs',
        identityPoolId: 'eu-central-1:023450d4-dfa43-123a-4533-dfsafdssa543,
        allowGuestAccess: true,
    }
};

export const apiConfig: ResourcesConfig['API'] = {
    GraphQL: {
        endpoint: 'https://dsfgafa4ew5w4xdgfd.appsync-api.eu-central-1.amazonaws.com/graphql',
        region: 'eu-central-1', // optional
        defaultAuthMode: 'userPool'
    }
};

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

@steffen-tomm steffen-tomm added the pending-triage Issue is pending triage label Apr 16, 2024
@cwomack cwomack self-assigned this Apr 16, 2024
@cwomack
Copy link
Contributor

cwomack commented Apr 16, 2024

Hello, @steffen-tomm 👋. Did you recently upgrade your app from v5 to v6 by chance, or is this a new v6 app? And can you share what's in your package.json file so we can see your dependencies?

@cwomack cwomack added dependencies Pull requests that update a dependency file question General question pending-response Issue is pending response from the issue requestor and removed pending-triage Issue is pending triage labels Apr 16, 2024
@cwomack
Copy link
Contributor

cwomack commented Apr 16, 2024

Additionally, can you see if taking the following steps helps resolve the issue?

  • Delete your node_modules folder
  • Delete your package-lock.json file
  • Reinstall dependencies with npm i

@steffen-tomm
Copy link
Author

steffen-tomm commented Apr 16, 2024

@cwomack i tried that already, good advise so far.

started directly with v6, like in that documentation:
https://docs.amplify.aws/nextjs/start/project-setup/create-application/

package.json looks like that:

{
  "name": "test",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@aws-amplify/adapter-nextjs": "^1.0.28",
    "aws-amplify": "^6.0.28",
    "classnames": "^2.5.1",
    "next": "^14.2.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@svgr/webpack": "^8.1.0",
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "autoprefixer": "^10.4.19",
    "eslint": "^8.57.0",
    "eslint-config-next": "^14.2.1",
    "postcss": "^8",
    "tailwindcss": "^3.4.3",
    "typescript": "^5"
  }
}

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue requestor label Apr 16, 2024
@steffen-tomm
Copy link
Author

import {type ResourcesConfig} from 'aws-amplify';

export const authConfig: ResourcesConfig['Auth'] = {
    Cognito: {
        userPoolId: 'eu-central-1_SSt3fgGcD',
        userPoolClientId: '5sdfs8fsafdsdvdsafsq2gphi5dsfs',
        identityPoolId: 'eu-central-1:023450d4-dfa43-123a-4533-dfsafdssa543,
        allowGuestAccess: true,
    }
};

export const apiConfig: ResourcesConfig['API'] = {
    GraphQL: {
        endpoint: 'https://dsfgafa4ew5w4xdgfd.appsync-api.eu-central-1.amazonaws.com/graphql',
        region: 'eu-central-1', // optional
        defaultAuthMode: 'userPool'
    }
};

that's my config. is something wrong here?

@cwomack
Copy link
Contributor

cwomack commented Apr 17, 2024

@steffen-tomm, I'm still a little lost as to how to reproduce this issue and get the errors you're seeing. You mentioned starting with the Next.JS getting started guide, but can you share the steps that different from our docs to get to where you're experiencing the build issues? Do you run into this with a fresh Next.JS project with Amplify imported or was this an existing project that you integrated Amplify into? And finally, do you experience this when running it locally as well?

@cwomack cwomack added the pending-response Issue is pending response from the issue requestor label Apr 17, 2024
@steffen-tomm
Copy link
Author

i started building the project two month ago, but never went through the build process, because i always ran
npm run dev
without any issues.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue requestor label Apr 18, 2024
@steffen-tomm
Copy link
Author

steffen-tomm commented Apr 18, 2024

i started the project like that:
https://docs.amplify.aws/nextjs/start/project-setup/create-application/
But i do not use a amplify backend.
I build my own written aws infrastructure

What can i do to make it work?

Transfer everything to a new instance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file Next.js question General question
Projects
None yet
Development

No branches or pull requests

2 participants