zhorton34 / laravel-mix-code-splitter

Install Laravel Homestead & Interact with artisan via your server through an alias command
Other
11 stars 3 forks source link

ReferenceError: File is not defined #3

Open alirezas opened 3 years ago

alirezas commented 3 years ago

I'm using these versions:

"laravel-mix": "^6.0.25"
"laravel-mix-code-splitter": "^1.0.5"

and I'm getting this error:

ReferenceError: File is not defined
    at isFolder (.../node_modules/laravel-mix-code-splitter/index.js:8:55)
    at ...node_modules/laravel-mix-code-splitter/index.js:12:13
    at Array.reduce (<anonymous>)
    at CollectFiles (...node_modules/laravel-mix-code-splitter/index.js:11:35)
    at CodeSplit.register (...node_modules/laravel-mix-code-splitter/index.js:44:9)
    at Object.components.<computed> [as split] (...node_modules/laravel-mix/src/components/ComponentRegistrar.js:133:53)
    at Object.<anonymous> (...webpack.mix.js:61:4)
    at Module._compile (...node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
adviva commented 3 years ago

Hi there, i'm getting the same error in the same way. Could some one give me any suggestion or news about bug fix? thanks a lot

joaojvt commented 2 years ago

The only way i found out to fix, it was to go the index file on the lib it self on node_moudules directory change the flowing line const isFolder = to => new File(path.resolve(to)).isDirectory(); to : const isFolder = to => fs.lstatSync(path.resolve(to)).isDirectory() and require the path module from node const path = require('path'); after that it worked properly

joaojvt commented 2 years ago

did a pull request to fix it, hope it helps...

sukmaw commented 2 years ago

i have getting some error, is this repo stil maintened ??