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.

Cannot read property 'spritemap': after update to v4.0

See original GitHub issue

Description After update to v4.0 error: Cannot read property ‘spritemap’ of undefined

Expected behavior Build without error

Actual behavior

(node:7608) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'spritemap' of undefined
    at SVGSpritemapPlugin.updateFilename (/home/user/works/example/node_modules/svg-spritemap-webpack-plugin/lib/index.js:431:43)
    at /home/user/works/example/node_modules/svg-spritemap-webpack-plugin/lib/index.js:221:22
    at Hook.eval [as call] (eval at create (/home/user/works/example/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Hook.CALL_DELEGATE [as _call] (/home/user/works/example/node_modules/webpack/node_modules/tapable/lib/Hook.js:14:14)
    at /home/user/works/example/node_modules/webpack/lib/Compilation.js:2470:28
    at /home/user/works/example/node_modules/webpack/lib/Compilation.js:2670:5
    at /home/user/works/example/node_modules/neo-async/async.js:2818:7
    at done (/home/user/works/example/node_modules/neo-async/async.js:3522:9)
    at /home/user/works/example/node_modules/webpack/lib/Compilation.js:2650:7
    at /home/user/works/example/node_modules/webpack/lib/Compilation.js:2738:32

System information

Minimal reproduction

        new SVGSpritemapPlugin([
            'source/img/svg-sprite/*.svg',
        ], {
            output: {
                filename: 'img/svg-sprite.svg',
                svg4everybody: false,
                svgo: false,
            },
            sprite: {
                prefix: (filename) => {
                    return 'icon-';
                },
                generate: {
                    title: false,
                },
            },
        }),

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:30 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
cascornelissencommented, May 25, 2021

Thanks again for the additional information, I’m pretty sure the fix in 7da9664 should resolve the path issue you’re running into.

The division symbol deprecation warning should be gone with the changes in 6296251. It’s a little more complicated than simply upgrading the generated sass file, other processors such as libsass don’t implement math.div ye. Luckily the chunking logic that was there for performance reasons back in the day could be removed.

In the future, creating a separate issue for something totally unrelated is usually the way to go to keep discussions on track ✌🏼

If you could test both of these by installing directly from GitHub, that’d be great! ❤️

npm install cascornelissen/svg-spritemap-webpack-plugin#master
1reaction
Dionocommented, May 18, 2021

yes i understood! I reduce to the minimal config => https://github.com/Diono/test without any options, i still have the problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

Programmatically creating SVG with Phaser 3: Cannot read ...
The problem is because of the atlas data structure. I should have been calling addAtlasJSONHash() instead of addAtlas() .
Read more >
Cannot read property 'tap' of undefined · Issue #255 - GitHub
Can't get it running with webpack 4.44.2 [webpack-cli] TypeError: Cannot read property 'tap' of undefined at FaviconsWebpackPlugin.apply ...
Read more >
Sage 10 - Bud doesn't start the dev server when using a plugin
When using the 'svg-spritemap-webpack-plugin' plugin on bud, the local ... TypeError: Cannot read properties of undefined (reading 'store').
Read more >
Cannot read property 'play' of undefined - Phaser 3
I'm having trouble getting a sprite animation to work. I'm trying to play a sprite animation the same why as in the “creating...
Read more >
Spritesheet loading error since update to 5.2.3 - Pixi.js
Howdy, I just updated pixi.js in my project from 5.2.1 to 5.2.4, ... Cannot read property 'baseTexture' of null at new Spritesheet ......
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