Vite won't compile on laravel 9 project. Error: EMFILE: too many open files - laravel

ghoul138
OP
Posted 1 second ago
Errors compiling Vite on the new Laravel 9 installation.
I've worked with Laravel v5.x and v6.x for years but decided to start a new small site on Laravel v9.x using "Laravel Sail" and surprisingly haven't had many issues until now.
I started working on a dashboard and making small changes, all of which have shown except for some style class tags for tailwind. I used 'sail down' to pull everything down and run 'sudo npm run dev' to see if that would fix it. Unfortunately, that brought about this error:
sudo npm run dev
> test#1.0.0 dev
> vite
node:internal/errors:491
ErrorCaptureStackTrace(err);
^
Error: EMFILE: too many open files, watch '/home/user/mount/Websites/test/app/View/Components'
at FSWatcher.<computed> (node:internal/fs/watchers:244:19)
at Object.watch (node:fs:2315:34)
at createFsWatchInstance (file:///home/user/mount/Websites/test/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:48596:17)
at setFsWatchListener (file:///home/user/mount/Websites/test/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:48643:15)
at NodeFsHandler._watchWithNodeFs (file:///home/user/mount/Websites/test/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:48798:14)
at NodeFsHandler._handleDir (file:///home/user/mount/Websites/test/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:49034:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async NodeFsHandler._addToNodeFs (file:///home/user/mount/Websites/test/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:49084:16)
at async file:///home/user/mount/Websites/test/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:50100:21
at async Promise.all (index 0)
Emitted 'error' event on FSWatcher instance at:
at FSWatcher._handleError (file:///home/user/mount/Websites/test/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:50296:10)
at NodeFsHandler._addToNodeFs (file:///home/user/mount/Websites/test/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:49112:18)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///home/user/mount/Websites/test/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:50100:21
at async Promise.all (index 0) {
errno: -24,
syscall: 'watch',
code: 'EMFILE',
path: '/home/user/mount/Websites/test/app/View/Components',
filename: '/home/user/mount/Websites/test/app/View/Components'
}
Node.js v18.13.0
I'm so lost and can't seem to find any good topics on this specific issue. Has this happened to anyone else?

Related

When using "npm run watch" the webpack get compiled with 2 erros and 6 warnings

I'm trying to use Laravel CMS for my portfolio when using the exact same repo on my mac I get no errors or warnings, but when I try using it on my Windows PC I get 6 warning and 2 errors. I'm a beginner level developer, so I don't really know how to read those warnings/errors.
Edit 1:
I forgot to mention that the path i used at first was public/images/<image.png> and the same error occured.
Aplication version's:
Php: 8.1.5
Laravel: 9.11.0
npm: 8.5.5
Here is the error snippet:
npm run watch
> watch
> mix watch
Error: Can't resolve '../../storage/app/resources/images/achtergrond.png' in 'C:\portfolio\resources\css'
at finishWithoutResolve (C:\node_modules\enhanced-resolve\lib\Resolver.js:309:18)
at C:\node_modules\enhanced-resolve\lib\Resolver.js:386:15
at C:\node_modules\enhanced-resolve\lib\Resolver.js:435:5
at eval (eval at create (C:\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:16:1
)
at C:\node_modules\enhanced-resolve\lib\Resolver.js:435:5
at eval (eval at create (C:\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:27:1
)
at C:\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:87:43
at C:\node_modules\enhanced-resolve\lib\Resolver.js:435:5
at eval (eval at create (C:\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1
)
at C:\node_modules\enhanced-resolve\lib\Resolver.js:435:5
at processResult (C:\node_modules\webpack\lib\NormalModule.js:758:19)
at C:\node_modules\webpack\lib\NormalModule.js:860:5
at C:\node_modules\loader-runner\lib\LoaderRunner.js:400:11
at C:\node_modules\loader-runner\lib\LoaderRunner.js:252:18
at context.callback (C:\node_modules\loader-runner\lib\LoaderRunner.js:124:13)
at Object.loader (C:\node_modules\css-loader\dist\index.js:155:5)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
webpack compiled with 2 errors and 6 warnings
If you need any more information just send me a message.
Thanks in advance!

Nuxtjs - Nuxt/Image module having issues on deployment

Im building a static page in nuxtjs. I added the module nuxt/image and set it up according to the instructions in the documentation. (static with self hosted images)
ssr:true,
target: 'statics",
buildModules: [
// https://go.nuxtjs.dev/vuetify
'#nuxtjs/vuetify',
//https://image.nuxtjs.org
'#nuxt/image'
],
<nuxt-link :to="localePath('/')">
<nuxt-img
id="header-logo"
format="webp"
src="/logos/logo.png">
</nuxt-img>
</nuxt-link>
When i run npm run dev the project compiles but then the development server exists without any errors.
When I deploy it to the server through github actions the action breaks and exits on nuxt generate with the exit code: /home/githubaction/actions-runner/workspace/_temp/eb47b4c6-6c0d-42cc-[9](https://github.com/xxxxxx/xxxxx/runs/6722739489?check_suite_focus=true#step:9:10)019-dca85b061dda.sh: line 1: 17085 Segmentation fault npm run generate Error: Process completed with exit code 139.
Any idea why is that?
Update
I downgraded from version 0.6.2 to 0.6.0 and this seems to resolve the issue.

What causes this webpack code 2 error and how to solve it?

Cannot even build in sidekick after a simple change
I created a new Core/TS project in Sidekick, I built the app and developed some stuff, but later I changed the icon to a nicer one (which requires a new build, no HMR for this type of change obviously), now I cannot build my app (cloud build, because I don't have Android Studio).
I checked the /main/assets/app/ and the icons were successfully changed there and they were existed.
What is happening? How do I fix this big issue? My patience bottle with all these critical errors even after simple changes is getting emptied.
I also tried "removing .cloud and folder directories", and clicking "clean cloud processes", adding "clean" option, etc...
But none worked.
I also updated the webpack.config.js file, with node_modules.bin\update-ns-webpack --configs
The file got successfully updated, but still did not solve the problem and I still cannot build.
Still after many hours cannot cloud build my app in sidekick. I also tried tns platform remove android, tns install, etc, etc... none worked out.
this is the error message:
[00:00:18.521] [WARN] Executing webpack failed with exit code 2.
[00:00:18.681] [ERROR] clean-webpack-plugin: /mnt/storage/builds/_/af8fe992d35e76b54f5523261a83dac973ffc9ed/5.3.4/5.3.1/Spread/platforms/android/app/src/main/assets/app/**/* has been removed.
Executing webpack failed with exit code 2.
'Build failed with error code 2'.
[19-06-10 19:13:56.767] Couldn't enable debugging for EP7333JKFA, Error: Couldn't enable debugging for EP7333JKFA
at Errors.fail (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\common\errors.js:126:28)
at Errors.failWithoutHelp (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\common\errors.js:136:21)
at LiveSyncService.<anonymous> (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:253:30)
at Generator.next (<anonymous>)
at C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:13:71
at new Promise (<anonymous>)
at __awaiter (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:9:12)
at LiveSyncService.enableDebuggingCoreWithoutWaitingCurrentAction (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:250:16)
at LiveSyncService.enableDebuggingCoreWithoutWaitingCurrentAction (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\common\decorators.js:67:47)
at LiveSyncService.<anonymous> (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:290:25)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:10:58)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
OUTPUT 2
EDIT:
SOLVED
https://github.com/NativeScript/sidekick-feedback/issues/384#issuecomment-508028462
I know this isn't an answer, but it is happening to me, too. I am running Nativescript 5.4.1. I can build with webpack, but as soon as I try to run with AOT or Uglify, I can't build and the error message isn't very helpful.
Try to remove and add 'nativescript-dev-webpack'-plugin using nativescript-sidekick-GUI, this resolve my issue...

Cannot run in production mode

I have a donejs application and its running ok in development mode donejs develop, but when I run it in production mode:
donejs build
donejs deploy (to firebase)
NODE_ENV=production donejs start
it will not start and show an error (see CODE A)
This file: file:my-app/dist/bundles/my-app/index.js:704 corresponds to JQuery 3.x and its not a dependency of the project itself but a dependency of can-connect-feathers (https://github.com/canjs/can-connect-feathers). In fact in index.js there is also included JQuery 2.x what makes me think there might be some sort of incompatibility among them.
I already tried changing the project's dependency to JQuery 3.x but didn't help. Actually it will make even donejs develop fail (see CODE B).
I also tried the following:
cd my-app/node_modules/steal
npm install
but didn't help, another error appears and finally tried cd my-app/node_modules/can && npm install but that end up in multiple errors.
I'm using:
donejs#0.9.2
node#4.6.2
npm#2.15.11
can-connect-feathers#1.2.1
CODE A
NODE_ENV=production donejs start
my-app#0.0.0 start my-app
done-serve --proxy http://localhost:3030 --port 8080
done-serve starting on http://localhost:8080
Potentially unhandled rejection [5] TypeError: Error loading "package.json!npm" at file:my-app/package.json
Error loading "bundles/my-app/index" at file:my-app/dist/bundles/my-app/index.js
Error evaluating file:my-app/dist/bundles/my-app/index.js
Cannot read property 'createElement' of undefined
at i (file:my-app/dist/bundles/my-app/index.js:704:20)
at file:my-app/dist/bundles/my-app/index.js:1039:2881
at file:my-app/dist/bundles/my-app/index.js:1039:3580
at file:my-app/dist/bundles/my-app/index.js:268:21
at file:my-app/dist/bundles/my-app/index.js:268:27
at Object.exports.runInThisContext (vm.js:54:17)
at doEval (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:2059:10)
at __eval (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1976:7)
at Loader.exec [as __exec] (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:339:5)
at Loader.loader.instantiate (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1517:16)
CODE B
donejs develop
my-app#0.0.0 develop my-app
done-serve --develop --proxy http://localhost:3030 --port 8080
done-serve starting on http://localhost:8080
Potentially unhandled rejection [8] Error: Error loading "my-app#0.0.0#index.stache!done-autorender#0.8.0#autorender" at <unknown>
Error loading "can#2.3.27#util/jquery/jquery" at file:my-app/node_modules/can/util/jquery/jquery.js
Error loading "can#2.3.27#util/jquery/jquery" from "done-autorender#0.8.0#autorender" at file:my-app/node_modules/done-autorender/src/autorender.js
Did not find ./node_modules/can/node_modules/jquery/package.json
at FetchTask.utils.extend.next (file:my-app/node_modules/steal/ext/npm-crawl.js:532:11)
at file:my-app/node_modules/steal/ext/npm-crawl.js:556:33
at tryCatchReject (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1183:30)
at runContinuation1 (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1142:4)
at Fulfilled.when (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:930:4)
at Pending.run (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:821:13)
at Scheduler._drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:97:19)
at Scheduler.drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:62:9)
at nextTickCallbackWith0Args (node.js:436:9)
at process._tickCallback (node.js:365:13)
Potentially unhandled rejection [16] Error: Error loading "can#2.3.27#util/jquery/jquery" at file:my-app/node_modules/can/util/jquery/jquery.js
Error loading "can#2.3.27#util/jquery/jquery" from "my-app#0.0.0#index.stache!done-autorender#0.8.0#autorender" at file:my-app/src/index.stache
Did not find ./node_modules/can/node_modules/jquery/package.json
at FetchTask.utils.extend.next (file:my-app/node_modules/steal/ext/npm-crawl.js:532:11)
at file:my-app/node_modules/steal/ext/npm-crawl.js:556:33
at tryCatchReject (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1183:30)
at runContinuation1 (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1142:4)
at Fulfilled.when (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:930:4)
at Pending.run (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:821:13)
at Scheduler._drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:97:19)
at Scheduler.drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:62:9)
at nextTickCallbackWith0Args (node.js:436:9)
at process._tickCallback (node.js:365:13)
If the double jQuery installation is the issue, it should be resolved by version 2.0.0, which is exactly the same as the 1.0 version, but requires that you pass in a jQuery package as the jquery option. So, in addition to whatever else you had in your can-connect-feathers config, you'll need to provide the jquery option:
import $ from 'jquery'
import Feathers from 'can-connect-feathers';
new Feathers({
jquery: $
});

Web starter kit gulp error on first install

trying out WSK, I just followed instructions on google dev website, this is my error after a $ gulp or $ gulp serve:
/folderpath/web-starter-kit-master/node_modules/gulp-ruby-sass/index.js:46
msg = msg.replace(new RegExp(path + '/?', 'g'), '');
^
SyntaxError: Invalid regular expression: //var/folders/F9/F9lleWHkHiiltRH5iZcuLk+++TI/-Tmp-/gulp-ruby-sass/?/: Nothing to repeat
at new RegExp (<anonymous>)
at /folderpath/web-starter-kit-master/node_modules/gulp-ruby-sass/index.js:46:21
at Array.forEach (native)
at removePaths (/folderpath/web-starter-kit-master/node_modules/gulp-ruby-sass/index.js:45:8)
at Socket.<anonymous> (/folderpath/web-starter-kit-master/node_modules /gulp-ruby-sass/index.js:118:14)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
Just ran into this (setting up WSK for the first time tonight too).
Looks like that was a bug that gulp-ruby-sass actually fixed a while ago:
https://github.com/rjm101/gulp-ruby-sass/commit/789d45f9b076781db652448a472357064a0f3e41
for whatever reason WSK doesn't have it yet in its node_modules dir.
I got this to work just by manually editing web-starter-kit-master/node_modules/gulp-ruby-sass/index.js locally and making the above linked change. I'm sure there's a more Proper way to deal with this but it's getting late and I'm losing patience :)

Resources