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.

Sprite doesn't get loaded

See original GitHub issue

Do you want to request a feature, report a bug or ask a question? Question

What is the current behavior? Svg is doesn’t get imported when extract: true

What is the expected behavior? Svg gets imported.

The best way is to create repo with minimal setup to demonstrate a problem (package.json, webpack config and your code). https://gist.github.com/srosca/80932a82e55e90c8409c6a6dc09f7e51

Please tell us about your environment:

  • Node.js version: 8.9.4
  • webpack version: 3.5.4
  • svg-sprite-loader version: 3.1.6
  • OS type & version: MacOX Sierra

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:9
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
martinkadlec0commented, Jul 22, 2018

Also stumbled upon this, we replaced extract-text-webpack-plugin with mini-css-extract-plugin and now the svg urls in our css files are replaced by absolute path to the svg file itself instead of url to the svg sprite.

Update: Mine problem sounds more like https://github.com/kisenka/svg-sprite-loader/issues/294 - or maybe its the same thing?

1reaction
wanecekcommented, Aug 3, 2018

I’m seeing the same error as @rguanghui while attempting to upgrade our build process from Webpack 3 to 4, during which I’ve also switched to mini-css-extract-plugin (just like @martinkadlec0). However - the symptom I’m experiencing is that the entire webpack build crashes, not that it’s inline instead of extracted.

When the error is thrown (from get-loader-options.js:26), the following values are assigned to the variables:

{ 
  loaderPath:
   '/home/wanecek/work/<redacted>/website/node_modules/svg-sprite-loader/lib/loader.js',
  rule: {
    resource: [Function: bound test],
    use: [ { options: undefined, loader: 'file-loader' } ]
  },
  multiRule: [ { options: undefined, loader: 'file-loader' } ],
  multiRuleProp: 'use'
}

rules.map(normalizeRule) evalutes to [{ loader: 'file-loader', options: null }], which makes the chained find method return undefined, causing an error to be thrown when the undefined.options is accessed.

Is it the getMatchedRule which extracts the wrong rule? Not too familiar with the plugin, will try to dig some more…

if the repo given by @evilebottnawi is insufficient, I can try creating a reproducible demo too… Let me know @kisenka 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

My sprite won't load! - Discuss Scratch
My sprite won't load! · 1. Check to see if the picture is secured or corrupted. It can prevent this. · 2. Make...
Read more >
c# - Unity - Sprite not properly loaded - Stack Overflow
I have to reload sprites / reload the scene in Unity inspector, but the load doesn't persist. Neither sprites, SpriteRenderer nor GameObject ...
Read more >
Saved sprite doesn't load on another scene - Forums
The easiest way to fix this is to copy the Easy Save 3 Manager from the scene where you saved the Sprite. And...
Read more >
Sprite won't load - Unity Forum
So I load my Sprite: spriteX = Resources.Load<UnityEngine.Sprite>("Sprites/xmark"); And I want to place another Sprite with it: clickedField.
Read more >
Sprite sometimes doesn't load - Phaser 3
This happens most often with the spaceStation which is the largest sprite at 3372x700 px. When the game first boots, the spaceStation isn't ......
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