question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"chunk.sortModules is not a function"

See original GitHub issue
  • Laravel Mix Version: 1.2.0
  • Node Version: 8.1.2
  • NPM Version: 5.2.0
  • OS: LMDE 2 Betsy

Description:

When running mix.sass() it seems to fail with the exception message TypeError: chunk.sortModules is not a function (stack trace below).

Steps To Reproduce:

Have a sass file and run mix.sass().

Stack trace:

advanced chunk optimization/home/user/project/node_modules/laravel-mix/node_modules/extract-text-webpack-plugin/dist/index.js:188
            chunk.sortModules();
                  ^

TypeError: chunk.sortModules is not a function
    at /home/user/project/node_modules/laravel-mix/node_modules/extract-text-webpack-plugin/dist/index.js:188:19
    at /home/user/project/node_modules/laravel-mix/node_modules/async/dist/async.js:3083:16
    at eachOfArrayLike (/home/user/project/node_modules/laravel-mix/node_modules/async/dist/async.js:1003:9)
    at eachOf (/home/user/project/node_modules/laravel-mix/node_modules/async/dist/async.js:1051:5)
    at Object.eachLimit (/home/user/project/node_modules/laravel-mix/node_modules/async/dist/async.js:3145:5)
    at Compilation.<anonymous> (/home/user/project/node_modules/laravel-mix/node_modules/extract-text-webpack-plugin/dist/index.js:184:27)
    at Compilation.applyPluginsAsyncSeries (/home/user/project/node_modules/tapable/lib/Tapable.js:142:13)
    at Compilation.seal (/home/user/project/node_modules/webpack/lib/Compilation.js:551:7)
    at Compiler.<anonymous> (/home/user/project/node_modules/webpack/lib/Compiler.js:436:15)
    at /home/user/project/node_modules/tapable/lib/Tapable.js:225:11
    at Compilation.<anonymous> (/home/user/project/node_modules/webpack/lib/Compilation.js:444:10)
    at /home/user/project/node_modules/webpack/lib/Compilation.js:420:12
    at /home/user/project/node_modules/webpack/lib/Compilation.js:332:10
    at /home/user/project/node_modules/async/lib/async.js:52:16
    at done (/home/user/project/node_modules/async/lib/async.js:246:17)
    at /home/user/project/node_modules/async/lib/async.js:44:16
    at /home/user/project/node_modules/webpack/lib/Compilation.js:332:10
    at /home/user/project/node_modules/async/lib/async.js:52:16
    at done (/home/user/project/node_modules/async/lib/async.js:246:17)
    at /home/user/project/node_modules/async/lib/async.js:44:16
    at /home/user/project/node_modules/webpack/lib/Compilation.js:332:10
    at /home/user/project/node_modules/async/lib/async.js:52:16
    at done (/home/user/project/node_modules/async/lib/async.js:246:17)
    at /home/user/project/node_modules/async/lib/async.js:44:16
    at /home/user/project/node_modules/webpack/lib/Compilation.js:332:10
    at /home/user/project/node_modules/async/lib/async.js:52:16
    at Object.async.forEachOf.async.eachOf (/home/user/project/node_modules/async/lib/async.js:236:30)
    at Object.async.forEach.async.each (/home/user/project/node_modules/async/lib/async.js:209:22)
    at Compilation.addModuleDependencies (/home/user/project/node_modules/webpack/lib/Compilation.js:192:8)
    at Compilation.processModuleDependencies (/home/user/project/node_modules/webpack/lib/Compilation.js:177:7)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:23

github_iconTop GitHub Comments

70reactions
brooksleecommented, Jul 14, 2017

I came across the same problem, and after revert the plugin to older version solved the problem

npm i extract-text-webpack-plugin@2.1.2

30reactions
BATMAH69commented, Jul 12, 2017

I had such a problem when I installed the extract-text-webpack-plugin@3 with the webpack@2. Then I sync versions and it error gone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"chunk.sortModules is not a function" · Issue #985 - GitHub
When running mix.sass() it seems to fail with the exception message TypeError: chunk.sortModules is not a function (stack trace below).
Read more >
Laravel npm run dev returns TypeError: chunk.sortModules is ...
First, remove the webpack plugin. Then install and build yarn using the following steps: npm install remove-webpack-plugin --save-dev; yarn ...
Read more >
chunk.sortModules(); - Laracasts
chunk.sortModules();. I get this problem when I try to run NPM. ... chunk.sortModules(); ^ TypeError: chunk.sortModules is not a function at ...
Read more >
chunk.sortModules() is not a function. - Bountysource
I just installed this plugin yesterday (release 3.0.2 ) and it immediately broke the compile process. λ npm run dev > arc@0.1.0 dev ......
Read more >
chunk.sortModules is not a function when running npm ...
Coding example for the question chunk.sortModules is not a function when running npm command-laravel.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found