Laravel-mix: mix.scripts not working without second argument

Created on 12 Jun 2018  路  2Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 2.1.11 (npm list --depth=0)
  • Node Version (node -v): v8.11.2
  • NPM Version (npm -v): 5.6.0
  • OS: Windows 10 Pro

Description:

Despite the documentation authorizing the use of mix.scripts() without a second argument, running npm run dev outputs this error :

AssertionError [ERR_ASSERTION]: mix.combine() requires a full output file path as the second argument.
    at Function.combine (C:\xampp\htdocs\app\node_modules\laravel-mix\src\Verify.js:50:9)
    at Combine.register (C:\xampp\htdocs\app\node_modules\laravel-mix\src\components\Combine.js:39:16)
    at Api.mix.(anonymous function).args [as scripts] (C:\xampp\htdocs\app\node_modules\laravel-mix\src\components\ComponentFactory.js:98:53)
    at Object.<anonymous> (C:\xampp\htdocs\app\webpack.mix.js:14:5)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)

Before trying to reproduce this error though, I got this error instead :

Error: EISDIR: illegal operation on a directory, open 'C:\xampp\htdocs\app'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.writeFileSync (fs.js:1299:33)
    at Function.concatenate.sync (C:\xampp\htdocs\app\node_modules\concatenate\lib\concatenate.js:128:8)
    at FileCollection.merge (C:\xampp\htdocs\app\node_modules\laravel-mix\src\FileCollection.js:29:36)
    at ConcatenateFilesTask.merge (C:\xampp\htdocs\app\node_modules\laravel-mix\src\tasks\ConcatenateFilesTask.js:18:37)
    at ConcatenateFilesTask.run (C:\xampp\htdocs\app\node_modules\laravel-mix\src\tasks\ConcatenateFilesTask.js:11:14)
    at CustomTasksPlugin.runTask (C:\xampp\htdocs\app\node_modules\laravel-mix\src\webpackPlugins\CustomTasksPlugin.js:33:14)
    at Mix.tasks.forEach.task (C:\xampp\htdocs\app\node_modules\laravel-mix\src\webpackPlugins\CustomTasksPlugin.js:9:44)
    at Array.forEach (<anonymous>)
    at Compiler.compiler.plugin.stats (C:\xampp\htdocs\app\node_modules\laravel-mix\src\webpackPlugins\CustomTasksPlugin.js:9:23)
    at Compiler.applyPlugins (C:\xampp\htdocs\app\node_modules\tapable\lib\Tapable.js:61:14)
    at emitRecords.err (C:\xampp\htdocs\app\node_modules\webpack\lib\Compiler.js:264:11)
    at Compiler.emitRecords (C:\xampp\htdocs\app\node_modules\webpack\lib\Compiler.js:371:38)
    at emitAssets.err (C:\xampp\htdocs\app\node_modules\webpack\lib\Compiler.js:258:10)
    at applyPluginsAsyncSeries1.err (C:\xampp\htdocs\app\node_modules\webpack\lib\Compiler.js:364:12)
    at next (C:\xampp\htdocs\app\node_modules\tapable\lib\Tapable.js:218:11)
    at Compiler.compiler.plugin (C:\xampp\htdocs\app\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (C:\xampp\htdocs\app\node_modules\tapable\lib\Tapable.js:222:13)
    at Compiler.afterEmit (C:\xampp\htdocs\app\node_modules\webpack\lib\Compiler.js:361:9)
    at require.forEach.err (C:\xampp\htdocs\app\node_modules\webpack\lib\Compiler.js:350:15)
    at C:\xampp\htdocs\app\node_modules\async\dist\async.js:473:16
    at iteratorCallback (C:\xampp\htdocs\app\node_modules\async\dist\async.js:1064:13)
    at C:\xampp\htdocs\app\node_modules\async\dist\async.js:969:16
    at C:\xampp\htdocs\app\node_modules\graceful-fs\graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)

Steps To Reproduce:

  1. laravel new app

  2. npm install

  3. Add mix.scripts(['foo.js', 'bar.js']); to webpack.mix.js

  4. npm run dev

All 2 comments

Not a big issue, docs may get outdated. Just pass second argument and chill

Yeah I ended up checking out more recent documentation and doing just that, thanks !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pixieaka picture pixieaka  路  3Comments

Bomavi picture Bomavi  路  3Comments

mstralka picture mstralka  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments

dtheb picture dtheb  路  3Comments