Blockchain code Metaverse VR

Crypto×VR×SmartContract(553)

スポンサーリンク

//tips

//smart contract

Vercelの下記に関する読み込みエラーについて調べていく。

./pages/ID/[id]/edit.js

Error: React Hook "useRouter" is called in function "edit" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use". react-hooks/rules-of-hooks

Error: React Hook "useRef" is called in function "edit" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use". react-hooks/rules-of-hooks

Error: React Hook "useState" is called in function "edit" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use". react-hooks/rules-of-hooks

Error: React Hook "useStyles" is called in function "edit" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use". react-hooks/rules-of-hooks

useSWRの使用に全て変えなければいけないかとドキドキしていたが、関数名の 1 文字目を大文字にすれば良いとのこと。

https://qiita.com/yamashin0616/items/43102dd617e2e0358183

https://stackoverflow.com/questions/30373343/reactjs-component-names-must-begin-with-capital-letters#:~:text=React%20recommend%20naming%20components%20with,before%20using%20it%20in%20JSX%20.

EditをEditに変更。無事にこの問題は解決した。

Githubに再度新たなレポジトリを作成し、格納。

git init
git add .
git commit -m "first commit“

git remote add origin https://github.com/
git push -u origin main

エラーが発生。

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

remote origin already exists.のためうまくいっていないよう。

対策として、下記を実行。

git remote rm origin

https://qiita.com/hatorijobs/items/1cae1946656ece954c63

これでもいけず、

git reset --hard origin/master

を実行。

今度は別のエラーが発生。

On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean

こちらを回避するためgitを初期化。

rm -rf .git/

error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/AkihiroNakamura2020/Vercel0502.git'

https://qiita.com/n0bisuke/items/93d30b863380df59163b

さらに下記も追加で試した。

git config --global init.defaultBranch main

https://zenn.dev/siba/articles/0c4c3510ddbc7d

https://qiita.com/n0bisuke/items/93d30b863380df59163b

最終的には問題が何かを特定するためにgitのコマンドの前にデバッグのコードも追加。

GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push -u origin main

何とか再度githubにアップロードしてvercelに読み込ませるもcan’tの’が認識されないとのこと。

367:30 Error: `'` can be escaped with `'`, `‘`, `'`, `’`. react/no-unescaped-entities

こちらを修正し再度トライ。

./pages/ID/[id].js
Module not found: Can't resolve '../../components/Notecard' in '/vercel/path0/pages/ID'

Path0の場合の対応をおこなっていないのでエラーが発生している。

Path0を無くすようにする。ここからはひたすらデプロイの試練に挑み続けるのみ。

 

人気の記事

1

皆さん、ついに、エアラインでも、サブスクリプションが始まったのはご存じですか? まだ実験段階ですが、ANAが、定額全国住み放題サービスを提供する「ADDress」と組んで、国内線を4回まで定額利用可能 ...

2

無料でネットショップを開けるアプリとして多くの人に驚きを与えたBASE株式会社が、2019年10月25日東証マザーズに上場しました。2020年2月時点で90万店を超えるショップを抱えるまでに成長してい ...

3

2011年にサービスを開始してから圧倒的な成長率を誇るインテリア通販サイト 【FLYMEe/フライミー】を皆さんご存じでしょうか。 「自分のイメージするインテリア、本当に欲しいインテリアがどこにあるの ...

4

ついに、noteの月間アクティブユーザー数が4400万人(2020年3月時点)に到達しました。 そもそも、「note」とは、クリエイターが、文章やマンガ、写真、音声を投稿することができ、ユーザーはその ...

5

ボードゲームカフェが1日2回転で儲かるという記事をみつけたので興味を持ち、調べてみました。 まずは、需要がどれくらいあるのか、市場のようすからみていきましょう。 世界最大のボードゲーム市場はドイツで、 ...

-Blockchain, code, Metaverse, VR
-, ,

Copyright© BUSINESS HUNTER , 2023 All Rights Reserved Powered by AFFINGER5.