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.

Webpack v5: Error: Module.issuerThere was no ModuleGraph assigned to the Module for backward-compat (Use the new API)

See original GitHub issue

I use laravel-mix. After switch to 6.0.0-beta release #webpack5 patch was very helpful and worked well for me. Thx) Now I’m upgrade plugin to v3.7.1 and get this error.

To reproduce package.json

{
    "name": "laravel-mix",
    "version": "1.0",
    "description": "",
    "scripts": {
        "dev": "yarn run development",
        "development": "npx mix",
        "watch": "npx mix watch",
        "prod": "yarn run production",
        "production": "npx mix -p"
    },
    "devDependencies": {
        "laravel-mix": "^6.0.0-beta.14",
        "postcss": "^8.1.6",
        "postcss-loader": "^4.0.4",
        "resolve-url-loader": "^3.1.2",
        "sass": "^1.29.0",
        "sass-loader": "^10.0.5",
        "svg-spritemap-webpack-plugin": "^3.7.1"
    },
    "main": "app.js",
    "dependencies": {
        "axios": "^0.20.0"
    },
    "browserslist": [
        "last 2 version",
        "> 1%",
        "IE 10"
    ],
    "author": "Sergey Buynitsky",
    "license": "ISC"
}

webpack.mix.js

const mix = require('laravel-mix');
const SVGSpritemap = require("svg-spritemap-webpack-plugin");

mix.webpackConfig({
    plugins: [
        new SVGSpritemap("src/svg/**/*.svg", {
            output: {
                filename: "svg/sprite.svg",
                svgo: {
                    plugins: [{
                        removeStyleElement: true
                    }]
                }
            },
            sprite: {
                prefix: "svg-",
                gutter: 10,
                generate: {
                    title: false,
                }
            },
            styles: {
                filename: "src/sass/include/sprite-svg.scss",
                format: 'data',
                keepAttributes: true,
                variables: {
                    sprites: 'svg-sprites',
                    sizes: 'svg-sizes',
                    variables: 'variables',
                    mixin: 'svg-sprite'
                }
            }
        })
    ]
});

mix.setPublicPath('./public')
    .js('./src/js/app.js', './public/assets/scripts')
    .sass('./src/sass/app.scss', './public/assets/styles');

Full error text

C:\www\_temp\laravel-mix> yarn run dev
yarn run v1.22.5
$ yarn run development
$ npx mix
75% sealing chunk optimization SplitChunksPluginC:\www\_temp\laravel-mix\node_modules\webpack\lib\ModuleGraph.js:676
                                        throw new Error(
                                        ^

Error: Module.issuerThere was no ModuleGraph assigned to the Module for backward-compat (Use the new API)
    at C:\www\_temp\laravel-mix\node_modules\webpack\lib\ModuleGraph.js:676:12
    at Function.getModuleGraphForModule (C:\www\_temp\laravel-mix\node_modules\webpack\lib\ModuleGraph.js:667:18)
    at RawModule.get issuer [as issuer] (C:\www\_temp\laravel-mix\node_modules\webpack\lib\Module.js:271:22)
    at Chunks._checkTest (C:\www\_temp\laravel-mix\node_modules\laravel-mix\src\Chunks.js:197:20)
    at C:\www\_temp\laravel-mix\node_modules\laravel-mix\src\Chunks.js:160:38
    at Array.every (<anonymous>)
    at C:\www\_temp\laravel-mix\node_modules\laravel-mix\src\Chunks.js:160:19
    at C:\www\_temp\laravel-mix\node_modules\webpack-merge\dist\join-arrays.js:40:38
    at C:\www\_temp\laravel-mix\node_modules\webpack-merge\dist\join-arrays.js:40:38
    at checkTest (C:\www\_temp\laravel-mix\node_modules\webpack\lib\optimize\SplitChunksPlugin.js:482:10)
npm ERR! code 1
npm ERR! path C:\www\_temp\laravel-mix
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c "webpack "--progress" "--config=C:\www\_temp\laravel-mix\node_modules\laravel-mix\setup\webpack.config.js""

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\bsv\AppData\Local\npm-cache\_logs\2020-11-10T08_08_10_897Z-debug.log
Done in 6.15s.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
danielbachhubercommented, Jan 14, 2021

@PrOpOvEdNiK This will be fixed in the next tagged release of Laravel Mix https://github.com/JeffreyWay/laravel-mix/pull/2768

1reaction
danielbachhubercommented, Jan 11, 2021

Thanks @PrOpOvEdNiK. I’ve opened a Laravel Mix issue about it: https://github.com/JeffreyWay/laravel-mix/issues/2767

Read more comments on GitHub >

github_iconTop Results From Across the Web

To v5 from v4 - webpack
This guide aims to help you migrating to webpack 5 when using webpack directly. If you are using a higher level tool to...
Read more >
Webpack 5 Adoption - Next.js
Using webpack 5 in your application has many benefits, notably: Improved Disk Caching: next build is significantly faster on subsequent builds; Improved Fast ......
Read more >
How to Prevent Webpack Error after npm Install?
This new error is a bit easier to solve. It comes explained in your error logs. In your webpack.make.js change the line:
Read more >
fork-ts-checker-webpack-plugin - npm
Runs typescript type checker and linter on separate process.. Latest version: 7.2.14, last published: 16 days ago. Start using ...
Read more >
Webpack 5 svg loader
Module.issuerThere was no ModuleGraph assigned to the Module for backward-compat (Use the new API). Web. Web. SVG Inline Loader for Webpack This Webpack...
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