前提
herokuへのデプロイ時に出るエラーが解決できず、アプリがデプロイできない。
ローカル環境(動作します)
laravel 9.19(sail 1.0.1) + node.js 18.12.1 + Vue 3.2.41 + Vite 2.5.10 + nodemon 2.0.20 + express 4.18.2 + socket.io 4.5.3
デプロイ先
hroku basic dyno(heroku-php-apache2)
実現したいこと
herokuへアプリをデプロイしたい
発生している問題・エラーメッセージ
-----> Build Running heroku-postbuild (yarn) yarn run v1.22.19 $ yarn run prod $ concurrently 'vite --port $PORT' 'nodemon --es-module-specifier-resolution=node server.mjs' [1] [nodemon] 2.0.20 [1] [nodemon] to restart at any time, enter `rs` [1] [nodemon] watching path(s): *.* [1] [nodemon] watching extensions: js,mjs,json [1] [nodemon] starting `node --es-module-specifier-resolution=node server.mjs` [1] (node:3378) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time. [1] (Use `node --trace-warnings ...` to show where the warning was created) [1] [1] App running in port 5000 [1] [1] > Local: https://****appname****.herokuapp.com:5000/ [0] Port 5000 is in use, trying another one... [0] [0] vite v2.9.15 dev server running at: [0] [0] > Local: http://localhost:5001/ [0] > Network: use `--host` to expose [0] [0] ready in 1071ms. [0] [0] [0] Laravel v9.43.0 [0] [0] > APP_URL: https://****appname****.herokuapp.com [0] node:internal/errors:484 [0] ErrorCaptureStackTrace(err); [0] ^ [0] [0] Error: ENOSPC: System limit for number of file watchers reached, watch '/tmp/build_43147a39/vendor/aws/aws-sdk-php/src/RedshiftDataAPIService/Exception/RedshiftDataAPIServiceException.php' [0] at FSWatcher.<computed> (node:internal/fs/watchers:244:19) [0] at Object.watch (node:fs:2315:34) [0] at createFsWatchInstance (/tmp/build_43147a39/node_modules/vite/dist/node/chunks/dep-689425f3.js:45537:17) [0] at setFsWatchListener (/tmp/build_43147a39/node_modules/vite/dist/node/chunks/dep-689425f3.js:45584:15) [0] at NodeFsHandler$1._watchWithNodeFs (/tmp/build_43147a39/node_modules/vite/dist/node/chunks/dep-689425f3.js:45739:14) [0] at NodeFsHandler$1._handleFile (/tmp/build_43147a39/node_modules/vite/dist/node/chunks/dep-689425f3.js:45803:23) [0] at NodeFsHandler$1._addToNodeFs (/tmp/build_43147a39/node_modules/vite/dist/node/chunks/dep-689425f3.js:46045:21) [0] Emitted 'error' event on FSWatcher instance at: [0] at FSWatcher._handleError (/tmp/build_43147a39/node_modules/vite/dist/node/chunks/dep-689425f3.js:47233:10) [0] at NodeFsHandler$1._addToNodeFs (/tmp/build_43147a39/node_modules/vite/dist/node/chunks/dep-689425f3.js:46053:18) { [0] errno: -28, [0] syscall: 'watch', [0] code: 'ENOSPC', [0] path: '/tmp/build_43147a39/vendor/aws/aws-sdk-php/src/RedshiftDataAPIService/Exception/RedshiftDataAPIServiceException.php', [0] filename: '/tmp/build_43147a39/vendor/aws/aws-sdk-php/src/RedshiftDataAPIService/Exception/RedshiftDataAPIServiceException.php' [0] } [0] [0] Node.js v18.12.1 [0] vite --port $PORT exited with code 1 -----> Timed out running buildpack Node.js Terminated node:events:491 throw er; // Unhandled 'error' event ^ Error: write EPIPE at afterWriteDispatched (node:internal/stream_base_commons:160:15) at writeGeneric (node:internal/stream_base_commons:151:3) at Socket._writeGeneric (node:net:917:11) at Socket._write (node:net:929:8) at writeOrBuffer (node:internal/streams/writable:392:12) at _write (node:internal/streams/writable:333:10) at Writable.write (node:internal/streams/writable:337:10) at OutputWriter.write (/tmp/build_43147a39/node_modules/concurrently/dist/src/output-writer.js:63:31) at Object.next (/tmp/build_43147a39/node_modules/concurrently/dist/src/concurrently.js:76:77) at ConsumerObserver.next (/tmp/build_43147a39/node_modules/rxjs/dist/cjs/internal/Subscriber.js:113:33) Emitted 'error' event on Socket instance at: at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -32, code: 'EPIPE', syscall: 'write' } Node.js v18.12.1 ! Push failed
該当のソースコード
package.json
1... 2 "nodemonConfig": { 3 "ignore": ["**/vendor/**", "**/node_modules/**","**/old/**","**/img/**"] 4 }, 5 6 "scripts": { 7 "heroku-postbuild": "yarn run prod", 8 "dev": "concurrently 'vite' 'nodemon --es-module-specifier-resolution=node server.mjs'", 9 "prod": "concurrently 'vite --port $PORT' 'nodemon --es-module-specifier-resolution=node server.mjs'" 10 }, 11...
vite.config.ts
1import { defineConfig } from 'vite'; 2import laravel from 'laravel-vite-plugin'; 3import vue from '@vitejs/plugin-vue'; 4import autoprefixer from "autoprefixer"; 5 6export default defineConfig({ 7 plugins: [ 8 laravel({ 9 input: ['resources/js/app.js'], 10 refresh: true, 11 }), 12 vue({ 13 template: { 14 transformAssetUrls: { 15 base: null, 16 includeAbsolute: false, 17 }, 18 }, 19 }), 20 ], 21 server: { 22 watch: { 23 usePolling: false, 24 ignored: ['*/vendor/','*/node_modules/'] 25 }, 26 }, 27 clearScreen: false, 28 css: { 29 postcss: { 30 plugins: [autoprefixer], 31 }, 32 }, 33});
Procfile
1web: nodemon server.mjs
試したこと
composer.jsonのpost-install-cmdにsudo sysctl fs.inotify.max_user_watches=582222 && sudo sysctl -pを足してみましたがダメでした。
(ローカル環境で同じエラーが出た時はそれで解決するらしいので…)
nodemonとviteにもignoredを設定したのですが、同じエラーが出続けます。
もう丸一日以上潰していてどうにもならないので質問させて頂きました。
お心当たりの方いらっしゃいましたら宜しくお願い致します。

回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
また依頼した内容が修正された場合は、修正依頼を取り消すようにしましょう。