jphacks / F_2111

baetoru
https://baetoru.tetsuzawa.com
MIT License
4 stars 0 forks source link

本番デプロイを試すスレッド #74

Closed tetsuzawa closed 2 years ago

tetsuzawa commented 2 years ago

フロントのビルドでエラー出た

version: 93ec6c0318841cf9fef8b68ec6eb0ea06b42ea3b

$ make prod_up

Step 6/16 : RUN NODE_ENV=production npm run build
 ---> Running in 9ca412707be7

> frontend@0.1.0 build
> next build

info  - Loaded env from /build/.env
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
Attention: Next.js now collects completely anonymous telemetry regarding usage.
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

info  - Checking validity of types...

....

warn  - The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config

Failed to compile.

./pages/_app.tsx
2:26  Error: 'Box' is defined but never used. Allowed unused vars must match /_/u.  @typescript-eslint/no-unused-vars

./pages/index.tsx
8:3  Error: Expected blank line before this statement.  padding-line-between-statements
16:55  Error: Prop spreading is forbidden  react/jsx-props-no-spreading
25:30  Error: Invalid type "string | undefined" of template literal expression.  @typescript-eslint/restrict-template-expressions

./pages/photo/[id].tsx
11:3  Error: Expected blank line before this statement.  padding-line-between-statements
40:20  Error: Prop spreading is forbidden  react/jsx-props-no-spreading
43:14  Error: Prop spreading is forbidden  react/jsx-props-no-spreading
62:8  Error: Invalid type "string | undefined" of template literal expression.  @typescript-eslint/restrict-template-expressions
62:58  Error: Invalid type "string | string[]" of template literal expression.  @typescript-eslint/restrict-template-expressions

./pages/upload/index.tsx
66:11  Error: Unsafe array destructuring of a tuple element with an `any` value.  @typescript-eslint/no-unsafe-assignment
66:17  Error: Unsafe array destructuring of a tuple element with an `any` value.  @typescript-eslint/no-unsafe-assignment
66:24  Error: Unsafe array destructuring of a tuple element with an `any` value.  @typescript-eslint/no-unsafe-assignment
66:34  Error: Unsafe array destructuring of a tuple element with an `any` value.  @typescript-eslint/no-unsafe-assignment
66:43  Error: Unsafe array destructuring of a tuple element with an `any` value.  @typescript-eslint/no-unsafe-assignment
66:57  Error: Unsafe array destructuring of a tuple element with an `any` value.  @typescript-eslint/no-unsafe-assignment
83:5  Error: Promises must be handled appropriately or explicitly marked as ignored with the `void` operator.  @typescript-eslint/no-floating-promises
127:15  Error: Prop spreading is forbidden  react/jsx-props-no-spreading
136:23  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment
138:27  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment
139:26  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment
140:31  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment
142:22  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment
143:24  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment

./src/components/pages/home/Photo.tsx
10:1  Error: Prefer default export.  import/prefer-default-export

./src/components/pages/photo/InfoTable.tsx
11:1  Error: Prefer default export.  import/prefer-default-export
25:14  Error: Unsafe member access .datetime on an `any` value.  @typescript-eslint/no-unsafe-member-access
25:14  Error: Must use destructuring res assignment  react/destructuring-assignment
29:14  Error: Must use destructuring res assignment  react/destructuring-assignment
33:14  Error: Unsafe member access .maker on an `any` value.  @typescript-eslint/no-unsafe-member-access
33:14  Error: Must use destructuring res assignment  react/destructuring-assignment
37:14  Error: Unsafe member access .camera on an `any` value.  @typescript-eslint/no-unsafe-member-access
37:14  Error: Must use destructuring res assignment  react/destructuring-assignment
41:14  Error: Unsafe member access .lens on an `any` value.  @typescript-eslint/no-unsafe-member-access
41:14  Error: Must use destructuring res assignment  react/destructuring-assignment
45:14  Error: Unsafe member access .flash on an `any` value.  @typescript-eslint/no-unsafe-member-access
45:14  Error: Must use destructuring res assignment  react/destructuring-assignment
49:14  Error: Unsafe member access .place on an `any` value.  @typescript-eslint/no-unsafe-member-access
49:14  Error: Must use destructuring res assignment  react/destructuring-assignment
53:14  Error: Unsafe member access .compass on an `any` value.  @typescript-eslint/no-unsafe-member-access
53:14  Error: Must use destructuring res assignment  react/destructuring-assignment
57:14  Error: Unsafe member access .fvalue on an `any` value.  @typescript-eslint/no-unsafe-member-access
57:14  Error: Must use destructuring res assignment  react/destructuring-assignment
61:14  Error: Unsafe member access .iso on an `any` value.  @typescript-eslint/no-unsafe-member-access
61:14  Error: Must use destructuring res assignment  react/destructuring-assignment
65:14  Error: Unsafe member access .speed on an `any` value.  @typescript-eslint/no-unsafe-member-access
65:14  Error: Must use destructuring res assignment  react/destructuring-assignment

./src/components/pages/photo/Map.tsx
3:1  Error: '@chakra-ui/layout' should be listed in the project's dependencies. Run 'npm i -S @chakra-ui/layout' to add it  import/no-extraneous-dependencies
9:3  Error: Unsafe return of an `any` typed value.  @typescript-eslint/no-unsafe-return
9:18  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
20:13  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
30:5  Error: Do not use "@ts-ignore" because it alters compilation errors.  @typescript-eslint/ban-ts-comment
31:11  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment
31:19  Error: Unsafe construction of an any type value.  @typescript-eslint/no-unsafe-call
31:23  Error: Unsafe member access .maps on an `any` value.  @typescript-eslint/no-unsafe-member-access
41:7  Error: Do not use "@ts-ignore" because it alters compilation errors.  @typescript-eslint/ban-ts-comment
42:13  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment
42:19  Error: Unsafe construction of an any type value.  @typescript-eslint/no-unsafe-call
42:23  Error: Unsafe member access .maps on an `any` value.  @typescript-eslint/no-unsafe-member-access
43:9  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment
47:7  Error: Do not use "@ts-ignore" because it alters compilation errors.  @typescript-eslint/ban-ts-comment
48:13  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment
48:20  Error: Unsafe construction of an any type value.  @typescript-eslint/no-unsafe-call
48:24  Error: Unsafe member access .maps on an `any` value.  @typescript-eslint/no-unsafe-member-access
49:9  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment
56:7  Error: Do not use "@ts-ignore" because it alters compilation errors.  @typescript-eslint/ban-ts-comment
57:13  Error: Unsafe assignment of an `any` value.  @typescript-eslint/no-unsafe-assignment
57:20  Error: Unsafe construction of an any type value.  @typescript-eslint/no-unsafe-call
57:24  Error: Unsafe member access .maps on an `any` value.  @typescript-eslint/no-unsafe-member-access
58:7  Error: Unsafe member access .setContent on an `any` value.  @typescript-eslint/no-unsafe-member-access
58:7  Error: Unsafe call of an `any` typed value.  @typescript-eslint/no-unsafe-call
59:7  Error: Unsafe member access .setPosition on an `any` value.  @typescript-eslint/no-unsafe-member-access
59:7  Error: Unsafe call of an `any` typed value.  @typescript-eslint/no-unsafe-call
60:7  Error: Unsafe member access .open on an `any` value.  @typescript-eslint/no-unsafe-member-access
60:7  Error: Unsafe call of an `any` typed value.  @typescript-eslint/no-unsafe-call
62:7  Error: Unsafe member access .setStreetView on an `any` value.  @typescript-eslint/no-unsafe-member-access
62:7  Error: Unsafe call of an `any` typed value.  @typescript-eslint/no-unsafe-call
63:8  Error: React Hook useEffect has missing dependencies: 'createCard' and 'place'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
73:1  Error: Prefer default export.  import/prefer-default-export

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
tetsuzawa commented 2 years ago

nexjsはexlintを検出するとproduction buildを落としてくれる https://nextjs.org/docs/api-reference/next.config.js/ignoring-eslint

ignoreしてみる

tetsuzawa commented 2 years ago

ignoreした

[root@ip-10-0-0-19 F_2111]# cat frontend/next.config.js
/** @type {import('next').NextConfig} */
module.exports = {
  reactStrictMode: true,
  images: {
    domains: ['baetoru-public.s3.ap-northeast-1.amazonaws.com'],
  },
  eslint: {
    // Warning: This allows production builds to successfully complete even if
    // your project has ESLint errors.
    ignoreDuringBuilds: true,
  }
}
tetsuzawa commented 2 years ago

いろいろ修正して動いた。 修正PRを書く

image