mikemartin / laravel-mix-pug-recursive

Laravel Mix Plugin for compiling Pug/Jade templates.
MIT License
2 stars 5 forks source link

TypeError: Assert.dependencies is not a function #9

Open belantikdev opened 2 years ago

belantikdev commented 2 years ago

Failed to compile pug files.

Node versions: v14.15.4, v14.16.0, and v16.13.1 OS: Ubuntu 18.04 Package Manager: Yarn and NPM Dependencies:

Error output:

$ mix
[webpack-cli] TypeError: Assert.dependencies is not a function
    at Object.pug (/home/html/node_modules/laravel-mix-pug-recursive/src/index.js:15:17)
    at Object.<anonymous> (/home/html/webpack.mix.js:55:5)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at module.exports (/home/html/node_modules/laravel-mix/setup/webpack.config.js:11:5)
    at loadConfigByPath (/home/html/node_modules/webpack-cli/lib/webpack-cli.js:1745:27)
mikemartin commented 2 years ago

Can you share your webpack config?

belantikdev commented 2 years ago

This is my webpack.mix.js config.

let path = require("path");
let fs = require("fs");
let mix = require("laravel-mix");

mix.pug = require("laravel-mix-pug-recursive");

mix.pug("src/pug/*.pug", path.resolve(__dirname, "dist"), {
    excludePath: "src/pug",
    locals: {
        config: { baseUrl: "http://localhost/" },
        datas: JSON.parse(fs.readFileSync("src/jsons/data.json", "utf-8"))
    },
    pug: {
        pretty: true
    }
});
LambertWSJ commented 2 years ago

@mikemartin newer version laravel-mix/Assert.js remove dependencies function,I use laravel-mix 6.0.18 work fine, but 6.0.41 got same issue