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

デプロイ時に出た修正をここにまとめる #289

Merged
merged 14 commits into from
Sep 9, 2024

Conversation

hikahana
Copy link
Collaborator

対応Issue

  • resolve #0
    なし、

概要

デプロイ時に発生した修正をここにまとめています。
キックオフ後マージ予定です。

実装詳細

minioの送信を修正
タイポの修正
prod用のmakeの修正

画面スクリーンショット等

テスト項目

  • [ ]
  • [ ]
  • [ ]

備考

@github-actions github-actions bot added frontend infra bug Something isn't working labels Aug 31, 2024
Copy link
Collaborator

@TkymHrt TkymHrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

エラーだけ確認しました。
ローカルでminioへの画像追加ができないんですが、できてますか?

import { Header, PrizeResult, Loading } from "@/components/common";
import { IoCloudUploadOutline } from "react-icons/ios";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

読み込み先は/io5ですね。

Suggested change
import { IoCloudUploadOutline } from "react-icons/ios";
import { IoCloudUploadOutline } from "react-icons/io5";

@@ -26,13 +26,12 @@ const Page: NextPage = () => {
);
const [prizeNameJp, setPrizeNameJp] = useState<string>("");
const [prizeNameEn, setPrizeNameEn] = useState<string>("");
const fileInputRef = useRef<HTMLInputElement>(null);
const [imageFile, setImageFile] = useState<File | null>(null);
const fileInputRef = useRef<HTMLInputElement>();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null 入れないとエラー出ませんか?

Suggested change
const fileInputRef = useRef<HTMLInputElement>();
const fileInputRef = useRef<HTMLInputElement>(null);

@hikahana hikahana requested a review from TkymHrt September 8, 2024 11:06
@hikahana
Copy link
Collaborator Author

hikahana commented Sep 8, 2024

bucketNameにendpoint入れてました。。。。。

Copy link
Collaborator

@TkymHrt TkymHrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

私のローカル環境でMinIOへのPOSTが動作しなかったため、コメントしたように修正したところ動作しました。そちらの環境ではどうでしょうか?

if (req.method === "POST") {
const form = formidable();

form.parse(req, async (err: any, fields: any, files: any) => {
form.parse(req, async (err: any, files: any) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parseメソッドは第3引数にファイルデータを渡すようなので、使用しない引数も挟まないと動作しないと思われます。

    parse<FieldKey extends string, FileKey extends string>(
        request: IncomingMessage,
    ): Promise<[Fields<FieldKey>, Files<FileKey>]>;
    parse<FieldKey extends string, FileKey extends string>(
        request: IncomingMessage,
        callback?: (err: any, fields: Fields<FieldKey>, files: Files<FileKey>) => void,
    ): void;
Suggested change
form.parse(req, async (err: any, files: any) => {
form.parse(req, async (err: any, _: Fields, files: Files) => {

型もany型はできるだけ避けて下記みたいな感じで!

import formidable, { Fields, Files } from "formidable";

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

治しました

@hikahana hikahana requested a review from TkymHrt September 8, 2024 14:45
Copy link
Collaborator

@TkymHrt TkymHrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hikahana hikahana merged commit 426d819 into develop Sep 9, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend infra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants