RintaroKinashi / Laravel-React-ts-docker

Laravel, React.tsのdocker開発環境
0 stars 0 forks source link

環境構築 #1

Open RintaroKinashi opened 10 months ago

RintaroKinashi commented 10 months ago

参考

React.tsはBreezeを利用して入れていく

docker-compose exec app composer require laravel/breeze --dev
docker-compose exec app php artisan breeze:install react --typescript
RintaroKinashi commented 10 months ago

疑問点

docker-compose exec app php artisan breeze:install react --typescript後に「src/resources/js/app.tsx」のようなjsファイル下にtsファイルが入る構成になる js→tsにリネームすると以下のエラーが発生する

vite v4.5.0 building for production...
✓ 25 modules transformed.
✓ built in 3.61s
[vite:load-fallback] Could not load /resources/js/Layouts/GuestLayout (imported by resources/ts/Pages/Auth/ForgotPassword.tsx): ENOENT: no such file or directory, open '/resources/js/Layouts/GuestLayout'
error during build:
Error: Could not load /resources/js/Layouts/GuestLayout (imported by resources/ts/Pages/Auth/ForgotPassword.tsx): ENOENT: no such file or directory, open '/resources/js/Layouts/GuestLayout'

src/resources/js/Pages/Auth/ForgotPassword.tsx見ても/resources/js/Layouts/GuestLayoutをロードしてそうな場所パッと見ないんよな。。 tsにリネームせずにjsのままだとエラーなし

docker compose exec app npm run build 
...
✓ built in 6.18s
RintaroKinashi commented 8 months ago