커뮤니티
포인트
로딩중
쿠폰
내 강의실
국비 신청 내역
수강권
증명서
숙제 피드백
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
web aws hosting 에러 문제
[왕초보] 비개발자를 위한, 웹개발 종합반 (프로그래밍 실무, 풀스택)
5주차
북마크
박*서
댓글
1
추천
0
조회수
16
조회수
16
답변 완료



웹개발, 앱개발 둘다 수강하고 있습니다. 현재 웹개발 강의 수강 후 next js로 반응형 웹/앱 을 만들어서 aws에 배포하려고 하는데, 그 과정에서 계속 오류가 나고 있습니다. 이 문제를 일주일정도 혼자 해결하려고 했는데 안되서 오류의 원인과 해결방법을 여쭤봅니다.



aws amplify 로 호스팅을 시도했는데, 오류가 납니다

체를 캡처해 주시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.




작성한 코드 및 에러 메세지

아래는 오류가 난 코드입니다.

오2022-10-01T06:17:18.522Z [INFO]: # Cloning repository: git@github.com:arty0928/SNS-Community-Instagram.git
2022-10-01T06:17:21.039Z [INFO]: Cloning into 'SNS-Community-Instagram'...
2022-10-01T06:17:21.039Z [INFO]: # Switching to commit: e5b8760e4e1eb64fe654b1d2baa22bbc9b9df7e8
2022-10-01T06:17:21.046Z [INFO]: Note: switching to 'e5b8760e4e1eb64fe654b1d2baa22bbc9b9df7e8'.
                 You are in 'detached HEAD' state. You can look around, make experimental
                 changes and commit them, and you can discard any commits you make in this
                 state without impacting any branches by switching back to a branch.
                 If you want to create a new branch to retain commits you create, you may
                 do so (now or later) by using -c with the switch command. Example:
                 git switch -c <new-branch-name>
                 Or undo this operation with:
                 git switch -
                 Turn off this advice by setting config variable advice.detachedHead to false
                 HEAD is now at e5b8760 1001
2022-10-01T06:17:21.098Z [INFO]: Successfully cleaned up Git credentials
2022-10-01T06:17:21.099Z [INFO]: # Checking for Git submodules at: /codebuild/output/src687705454/src/SNS-Community-Instagram/.gitmodules
2022-10-01T06:17:21.124Z [INFO]: # Retrieving environment cache...
2022-10-01T06:17:21.746Z [INFO]: # Retrieved environment cache
2022-10-01T06:17:21.831Z [INFO]: ---- Setting Up SSM Secrets ----
2022-10-01T06:17:21.831Z [INFO]: SSM params {"Path":"/amplify/d2pnqm4mqnrup0/main/","WithDecryption":true}
2022-10-01T06:17:21.865Z [WARNING]: !Failed to set up process.env.secrets
2022-10-01T06:17:21.867Z [INFO]: No live updates for this build run
2022-10-01T06:17:21.871Z [INFO]: # Retrieving cache...
2022-10-01T06:17:21.918Z [INFO]: # Extracting cache...
2022-10-01T06:17:21.926Z [INFO]: # Extraction completed
2022-10-01T06:18:18.836Z [INFO]: ## Starting Backend Build
                 ## Checking for associated backend environment...
                 ## No backend environment association found, continuing...
                 ## Completed Backend Build
2022-10-01T06:18:18.839Z [INFO]: {"backendDuration": 0}
                 ## Starting Frontend Build
                 # Starting phase: preBuild
                 # Executing command: yarn install
2022-10-01T06:18:19.611Z [INFO]: yarn install v1.22.0
2022-10-01T06:18:19.696Z [INFO]: [1/4] Resolving packages...
2022-10-01T06:18:21.818Z [INFO]: [2/4] Fetching packages...
2022-10-01T06:18:34.431Z [WARNING]: warning url-loader@1.1.2: Invalid bin field for "url-loader".
2022-10-01T06:18:39.996Z [INFO]: info @next/swc-win32-x64-msvc@12.3.0: The platform "linux" is incompatible with this module.
                 info "@next/swc-win32-x64-msvc@12.3.0" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-10-01T06:18:39.998Z [INFO]: info @next/swc-darwin-arm64@12.3.0: The platform "linux" is incompatible with this module.
                 info "@next/swc-darwin-arm64@12.3.0" is an optional dependency and failed compatibility check. Excluding it from installation.
                 info @next/swc-darwin-arm64@12.3.0: The CPU architecture "x64" is incompatible with this module.
                 info @next/swc-linux-arm-gnueabihf@12.3.0: The CPU architecture "x64" is incompatible with this module.
                 info "@next/swc-linux-arm-gnueabihf@12.3.0" is an optional dependency and failed compatibility check. Excluding it from installation.
                 info @next/swc-freebsd-x64@12.3.0: The platform "linux" is incompatible with this module.
                 info "@next/swc-freebsd-x64@12.3.0" is an optional dependency and failed compatibility check. Excluding it from installation.
                 info @next/swc-android-arm-eabi@12.3.0: The platform "linux" is incompatible with this module.
                 info "@next/swc-android-arm-eabi@12.3.0" is an optional dependency and failed compatibility check. Excluding it from installation.
                 info @next/swc-android-arm-eabi@12.3.0: The CPU architecture "x64" is incompatible with this module.
                 info @next/swc-win32-arm64-msvc@12.3.0: The platform "linux" is incompatible with this module.
                 info "@next/swc-win32-arm64-msvc@12.3.0" is an optional dependency and failed compatibility check. Excluding it from installation.
                 info @next/swc-win32-arm64-msvc@12.3.0: The CPU architecture "x64" is incompatible with this module.
                 info @next/swc-win32-ia32-msvc@12.3.0: The platform "linux" is incompatible with this module.
                 info "@next/swc-win32-ia32-msvc@12.3.0" is an optional dependency and failed compatibility check. Excluding it from installation.
                 info @next/swc-win32-ia32-msvc@12.3.0: The CPU architecture "x64" is incompatible with this module.
                 info @next/swc-linux-arm64-gnu@12.3.0: The CPU architecture "x64" is incompatible with this module.
                 info "@next/swc-linux-arm64-gnu@12.3.0" is an optional dependency and failed compatibility check. Excluding it from installation.
                 info @next/swc-linux-arm64-musl@12.3.0: The CPU architecture "x64" is incompatible with this module.
                 info "@next/swc-linux-arm64-musl@12.3.0" is an optional dependency and failed compatibility check. Excluding it from installation.
                 info @next/swc-android-arm64@12.3.0: The platform "linux" is incompatible with this module.
                 info "@next/swc-android-arm64@12.3.0" is an optional dependency and failed compatibility check. Excluding it from installation.
                 info @next/swc-android-arm64@12.3.0: The CPU architecture "x64" is incompatible with this module.
                 info @next/swc-darwin-x64@12.3.0: The platform "linux" is incompatible with this module.
                 info "@next/swc-darwin-x64@12.3.0" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-10-01T06:18:40.003Z [INFO]: info fsevents@2.3.2: The platform "linux" is incompatible with this module.
2022-10-01T06:18:40.003Z [INFO]: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-10-01T06:18:40.004Z [INFO]: [3/4] Linking dependencies...
2022-10-01T06:18:40.007Z [WARNING]: warning "next-optimized-images > file-loader@3.0.1" has unmet peer dependency "webpack@^4.0.0".
2022-10-01T06:18:40.007Z [WARNING]: warning "next-optimized-images > raw-loader@2.0.0" has unmet peer dependency "webpack@^4.3.0".
                  warning "next-optimized-images > url-loader@1.1.2" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
2022-10-01T06:18:45.062Z [INFO]: [4/4] Building fresh packages...
2022-10-01T06:18:45.404Z [INFO]: success Saved lockfile.
2022-10-01T06:18:45.408Z [INFO]: Done in 25.80s.
2022-10-01T06:18:45.429Z [INFO]: # Completed phase: preBuild
                 # Starting phase: build
2022-10-01T06:18:45.430Z [INFO]: # Executing command: yarn run build
2022-10-01T06:18:45.546Z [INFO]: yarn run v1.22.0
2022-10-01T06:18:45.571Z [INFO]: $ next build && next export
2022-10-01T06:18:45.934Z [WARNING]: warn - Invalid next.config.js options detected:
2022-10-01T06:18:45.936Z [WARNING]: - The root value has an unexpected property, mode, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
2022-10-01T06:18:45.936Z [WARNING]: - The root value has an unexpected property, theme, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
                  - The root value has an unexpected property, variants, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
                  - The root value has an unexpected property, plugins, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
                  See more info here: https://nextjs.org/docs/messages/invalid-next-config
2022-10-01T06:18:45.938Z [INFO]: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
2022-10-01T06:18:45.981Z [INFO]: Attention: Next.js now collects completely anonymous telemetry regarding usage.
2022-10-01T06:18:45.981Z [INFO]: This information is used to shape Next.js' roadmap and prioritize features.
                 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
                 https://nextjs.org/telemetry
2022-10-01T06:18:46.067Z [INFO]: info - Linting and checking validity of types...
2022-10-01T06:18:48.066Z [INFO]: info - Creating an optimized production build...
2022-10-01T06:19:17.520Z [INFO]: info - Compiled successfully
2022-10-01T06:19:17.521Z [INFO]: info - Collecting page data...
2022-10-01T06:19:21.832Z [INFO]: info - Generating static pages (0/10)
2022-10-01T06:19:21.879Z [INFO]: info - Generating static pages (2/10)
2022-10-01T06:19:21.883Z [INFO]: info - Generating static pages (4/10)
2022-10-01T06:19:21.893Z [INFO]: info - Generating static pages (7/10)
2022-10-01T06:19:21.899Z [INFO]: info - Generating static pages (10/10)
2022-10-01T06:19:21.915Z [INFO]: info - Finalizing page optimization...
2022-10-01T06:19:21.924Z [INFO]: 
2022-10-01T06:19:21.943Z [INFO]: Route (pages)               Size   First Load JS
                 ┌ ○ /                   212 B     1.22 MB
                 ├  /_app                 0 B       110 kB
                 ├ ○ /404                  194 B      110 kB
                 ├ λ /api/auth/[...nextauth]        0 B       110 kB
                 ├ λ /api/hello               0 B       110 kB
                 ├ ○ /auth/Exercise             3.19 kB    1.22 MB
                 ├ ○ /auth/Hobby              3.18 kB    1.22 MB
                 ├ ○ /auth/Introduce            396 B     1.22 MB
                 ├ ○ /auth/Invest              3.19 kB    1.22 MB
                 ├ ○ /auth/News               3.18 kB    1.22 MB
                 ├ ○ /auth/Reading             3.19 kB    1.22 MB
                 ├ λ /auth/signin              664 B     1.22 MB
                 └ ○ /auth/Study              3.18 kB    1.22 MB
                 + First Load JS shared by all       115 kB
                 ├ chunks/framework-4556c45dd113b893.js  45.2 kB
                 ├ chunks/main-0f30a12cc71a3154.js    31.2 kB
                 ├ chunks/pages/_app-c5a4783636926992.js 32.7 kB
                 ├ chunks/webpack-cb7634a8b6194820.js   884 B
                 └ css/9331222e262f4b1a.css        5.25 kB
2022-10-01T06:19:21.944Z [INFO]: λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
                 ○ (Static) automatically rendered as static HTML (uses no initial props)
2022-10-01T06:19:22.463Z [WARNING]: warn - Invalid next.config.js options detected:
2022-10-01T06:19:22.464Z [WARNING]: - The root value has an unexpected property, mode, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
2022-10-01T06:19:22.465Z [WARNING]: - The root value has an unexpected property, theme, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
                  - The root value has an unexpected property, variants, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
                  - The root value has an unexpected property, plugins, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
                  See more info here: https://nextjs.org/docs/messages/invalid-next-config
2022-10-01T06:19:22.569Z [INFO]: info - using build directory: /codebuild/output/src687705454/src/SNS-Community-Instagram/.next
2022-10-01T06:19:22.572Z [INFO]: info - Copying "static build" directory
2022-10-01T06:19:22.575Z [INFO]: info - No "exportPathMap" found in "/codebuild/output/src687705454/src/SNS-Community-Instagram/next.config.js". Generating map from "./pages"
2022-10-01T06:19:22.576Z [INFO]: info - Launching 3 workers
2022-10-01T06:19:22.576Z [WARNING]: warn - Statically exporting a Next.js application via `next export` disables API routes.
                  This command is meant for static-only hosts, and is not necessary to make your application static.
                  Pages in your application without server-side data dependencies will be automatically statically exported by `next build`, including pages powered by `getStaticProps`.
                  Learn more: https://nextjs.org/docs/messages/api-routes-static-export
2022-10-01T06:19:22.577Z [INFO]: info - Exporting (0/11)
2022-10-01T06:19:22.577Z [INFO]: info - Copying "public" directory
2022-10-01T06:19:22.775Z [INFO]: info - Exporting (2/11)
2022-10-01T06:19:22.778Z [INFO]: info - Exporting (5/11)
2022-10-01T06:19:22.854Z [INFO]: info - Exporting (8/11)
2022-10-01T06:19:23.338Z [WARNING]: Error occurred prerendering page "/auth/signin". Read more: https://nextjs.org/docs/messages/prerender-error
                  Error: Error for page /auth/signin: pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export
                  at /codebuild/output/src687705454/src/SNS-Community-Instagram/node_modules/next/dist/export/worker.js:218:27
                  at async Span.traceAsyncFn (/codebuild/output/src687705454/src/SNS-Community-Instagram/node_modules/next/dist/trace/trace.js:79:20)
2022-10-01T06:19:23.339Z [INFO]: info - Exporting (11/11)
2022-10-01T06:19:23.342Z [WARNING]: Error: Export encountered errors on following paths:
                  /auth/signin
                  at /codebuild/output/src687705454/src/SNS-Community-Instagram/node_modules/next/dist/export/index.js:394:19
                  at processTicksAndRejections (internal/process/task_queues.js:95:5)
                  at async Span.traceAsyncFn (/codebuild/output/src687705454/src/SNS-Community-Instagram/node_modules/next/dist/trace/trace.js:79:20)
2022-10-01T06:19:23.363Z [WARNING]: error Command failed with exit code 1.
2022-10-01T06:19:23.364Z [INFO]: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2022-10-01T06:19:23.370Z [ERROR]: !!! Build failed
2022-10-01T06:19:23.370Z [ERROR]: !!! Non-Zero Exit Code detected
2022-10-01T06:19:23.370Z [INFO]: # Starting environment caching...
2022-10-01T06:19:23.371Z [INFO]: # Environment caching completed
Terminating logging...
류 발생 시, 작성한 코드 전체와 에러 메시지를 첨부해 주세요.
Tip 1) </> 아이콘을 눌러 코드박스를 만들어 보세요.
Tip 2) Ctrl+A(맥의 경우 Command+A) 단축키로 코드를 한 번에 선택할 수 있어요!



아래는 제 next.config.js 코드입니다.

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
  swcMinify: true,
}

const colors = require('tailwindcss/colors')

module.exports = {
  images: {
    domains: ['localhost', 'images.unsplash.com', 'googleusercontent.com','lh3.googleusercontent.com',
      'firebasestorage.googleapis.com', 'googleapis.com','cloudflare-ipfs.com']
    
  },
  
  mode: 'jit',
  theme: {
    extend: {
      colors: {
        sky: colors.sky,
        cyan: colors.cyan,
      },
      backgroundColor: ['active'],
    },
  },
  variants: {},
  plugins: [],
}


아래는 package.json 코드입니다.

{
  "name": "my-project",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build && next export",
    "start": "next start",
    "lint": "next lint",
    "netlify-deploy": "next build && next export"
  },
  "dependencies": {
    "@faker-js/faker": "^7.5.0",
    "@headlessui/react": "^1.7.2",
    "@heroicons/react": "^1.0.6",
    "@tailwindcss/forms": "^0.5.3",
    "fake": "^0.2.2",
    "faker": "^6.6.6",
    "firebase": "^9.10.0",
    "moment": "^2.29.4",
    "next": "12.3.0",
    "next-auth": "^4.10.3",
    "next-optimized-images": "^2.6.2",
    "prop-types": "^15.8.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-moment": "^1.1.2",
    "react-router-dom": "^6.4.1",
    "recoil": "^0.7.5",
    "tailwind-scrollbar-hide": "^1.1.7",
    "typescript": "^4.8.4"
  },
  "devDependencies": {
    "autoprefixer": "^10.4.11",
    "eslint": "8.23.1",
    "eslint-config-next": "12.3.0",
    "postcss": "^8.4.16",
    "tailwind-scrollbar": "^2.0.1",
    "tailwindcss": "^3.1.8"
  }
}
취소
 공유
취소
댓글 0
댓글 알림
나의얼굴