Ошибка сборки, возникающая в nextjs для aws-sdk

Я получаю следующую ошибку сборки. Я не уверен, как действовать дальше. Я впервые создаю сборку.

> next build

  ▲ Next.js 14.2.3
  - Environments: .env

   Creating an optimized production build ...
Failed to compile.

./node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js + 43 modules
Cannot get final name for export 'NO_RETRY_INCREMENT' of ./node_modules/@smithy/util-retry/dist-es/index.js


> Build failed because of webpack errors

Зависимости в package.json:

"dependencies": {
        "@ai-sdk/openai": "^0.0.40",
        "@assistant-ui/react": "^0.5.26",
        "@assistant-ui/react-ai-sdk": "^0.5.13",
        "@assistant-ui/react-markdown": "^0.2.7",
        "@assistant-ui/react-syntax-highlighter": "^0.0.8",
        "@aws-sdk/client-s3": "^3.627.0",
        "@aws-sdk/middleware-sdk-s3": "^3.626.0",
        "@aws-sdk/s3-request-presigner": "^3.622.0",
        "@hookform/resolvers": "^3.9.0",
        "@kinde-oss/kinde-auth-nextjs": "^2.2.10",
        "@monaco-editor/react": "^4.6.0",
        "@prisma/client": "^3.15.2",
        "@radix-ui/react-accordion": "^1.2.0",
        "@radix-ui/react-alert-dialog": "^1.1.1",
        "@radix-ui/react-aspect-ratio": "^1.1.0",
        "@radix-ui/react-avatar": "^1.0.4",
        "@radix-ui/react-checkbox": "^1.1.1",
        "@radix-ui/react-collapsible": "^1.1.0",
        "@radix-ui/react-context-menu": "^2.2.1",
        "@radix-ui/react-dialog": "^1.1.1",
        "@radix-ui/react-dropdown-menu": "^2.0.6",
        "@radix-ui/react-hover-card": "^1.1.1",
        "@radix-ui/react-label": "^2.1.0",
        "@radix-ui/react-menubar": "^1.1.1",
        "@radix-ui/react-navigation-menu": "^1.2.0",
        "@radix-ui/react-popover": "^1.1.1",
        "@radix-ui/react-progress": "^1.1.0",
        "@radix-ui/react-radio-group": "^1.2.0",
        "@radix-ui/react-scroll-area": "^1.1.0",
        "@radix-ui/react-select": "^2.1.1",
        "@radix-ui/react-separator": "^1.1.0",
        "@radix-ui/react-slider": "^1.2.0",
        "@radix-ui/react-slot": "^1.1.0",
        "@radix-ui/react-switch": "^1.1.0",
        "@radix-ui/react-tabs": "^1.1.0",
        "@radix-ui/react-toast": "^1.2.1",
        "@radix-ui/react-toggle": "^1.1.0",
        "@radix-ui/react-toggle-group": "^1.1.0",
        "@radix-ui/react-tooltip": "^1.1.2",
        "@stripe/stripe-js": "^3.4.0",
        "@t3-oss/env-nextjs": "^0.10.1",
        "@tanstack/react-query": "^4.36.1",
        "@trpc/client": "^10.45.2",
        "@trpc/next": "^10.45.2",
        "@trpc/react-query": "^10.45.2",
        "@trpc/server": "^10.45.2",
        "@types/react-syntax-highlighter": "^15.5.13",
        "ai": "^3.3.0",
        "aws-sdk": "^2.1664.0",
        "axios": "^1.7.2",
        "class-variance-authority": "^0.7.0",
        "clsx": "^2.1.1",
        "cmdk": "^1.0.0",
        "data-fns": "^1.1.0",
        "date-fns": "^3.6.0",
        "embla-carousel-react": "^8.1.8",
        "fast-xml-parser": "^4.4.1",
        "input-otp": "^1.2.4",
        "js-cookie": "^3.0.5",
        "lucide-react": "^0.378.0",
        "next": "14.2.3",
        "next-themes": "^0.3.0",
        "openai": "^4.54.0",
        "react": "^18",
        "react-colorful": "^5.6.1",
        "react-day-picker": "^8.10.1",
        "react-dom": "^18",
        "react-dropzone": "^14.2.3",
        "react-file-icon": "^1.5.0",
        "react-hook-form": "^7.52.1",
        "react-pro-sidebar": "^1.1.0",
        "react-resizable-panels": "^2.0.22",
        "react-syntax-highlighter": "^15.5.0",
        "recharts": "^2.12.7",
        "rehype-katex": "^7.0.0",
        "remark-gfm": "^4.0.0",
        "remark-math": "^6.0.0",
        "server-only": "^0.0.1",
        "sonner": "^1.4.41",
        "stripe": "^15.7.0",
        "superjson": "^2.2.1",
        "tailwind-merge": "^2.3.0",
        "tailwindcss-animate": "^1.0.7",
        "uploadthing": "^6.13.2",
        "uuid": "^10.0.0",
        "vaul": "^0.9.1",
        "webpack": "^5.93.0",
        "zod": "^3.23.8",
        "zustand": "^4.5.4"
    },
    "devDependencies": {
        "@types/js-cookie": "^3.0.6",
        "@types/node": "^20",
        "@types/react": "^18",
        "@types/react-dom": "^18",
        "@types/react-file-icon": "^1.0.4",
        "@types/uuid": "^10.0.0",
        "eslint": "^8",
        "eslint-config-next": "14.2.3",
        "npm-force-resolutions": "^0.0.10",
        "postcss": "^8",
        "prisma": "^3.15.2",
        "tailwindcss": "^3.4.1",
        "typescript": "^5",
        "zod-prisma": "^0.5.4"
    }
Настройка шаблона Metronic с помощью Webpack и Gulp
Настройка шаблона Metronic с помощью Webpack и Gulp
Я пишу эту статью, чтобы поделиться тем, как настроить макет Metronic с помощью Sass, поскольку Metronic предоставляет так много документации, и они...
0
0
50
2
Перейти к ответу Данный вопрос помечен как решенный

Ответы 2

Я не особо исследую, но понижение версии @aws-sdk может временно исправить ошибки сборки.

"@aws-sdk/client-s3": "3.620.0",
"@aws-sdk/s3-request-presigner": "3.620.0"

нашел правильное решение: github.com/vercel/next.js/issues/59344#issuecomment-18461287‌​59

青云Lab 12.08.2024 04:53
Ответ принят как подходящий

Использование идеи, предложенной здесь: https://github.com/vercel/next.js/issues/60807#issuecomment-2016600344

Мне удалось это исправить, добавив serverComponentsExternalPackages: ['@aws-sdk/client-s3', '@aws-sdk/s3-request-presigner'], в мой next.config.mjs файл.

Другие вопросы по теме