Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression, sprite.stringify() returns no symbols in 4.1.6 when 4.1.3 works ok #350

Open
hinok opened this issue Jul 31, 2019 · 2 comments

Comments

@hinok
Copy link

hinok commented Jul 31, 2019

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

What is the current behavior?

After upgrading to v4.1.6, calling sprite.stringify() returns no symbols.
It works without issues with v4.1.3.

What is the expected behavior?

sprite.stringify() should return stringified symbols.

Part of webpack config for svg-sprite-loader

if (env.serverSideRendering || env.storybook) {
    return {
      module: {
        rules: [
          {
            test: /.*\.svg$/i,
            use: 'svg-sprite-loader',
            include: /assets\/glyphs/,
            exclude: /node_modules/,
          },
        ],
      },
    };
  }

  // For client bundle, we don't want to store contents of SVG files
  // therefore we use extract mode to provide only "minimal" amount
  // of data about SVG files (viewbox, id and url)
  // @see https://github.com/kisenka/svg-sprite-loader#extract-configuration
  return {
    module: {
      rules: [
        {
          test: /.*\.svg$/i,
          loader: 'svg-sprite-loader',
          include: /assets\/glyphs/,
          exclude: /node_modules/,
          options: {
            extract: true,
            runtimeGenerator: require.resolve('./svgRuntimeGenerator'),
          },
        },
      ],
    },
    plugins: [
      new SpriteLoaderPlugin({ plainSprite: true }),
    ],
  };

Please tell us about your environment:

  • Node.js version: 8.11.3?
  • webpack version: 4.38.0?
  • svg-sprite-loader version: 4.1.6
  • OS type & version: macOS 10.14.5
@ydfzgyj
Copy link
Contributor

ydfzgyj commented Nov 6, 2019

Same question when execute SSR in nodejs. I believe this problem was introduced in PR #345 which used absolute path when import sprite.build. I have never used yarn before so I'm not able to fix it, @bimbiltu do you have any time to have a look at this bug?

@RikoRodriges
Copy link

RikoRodriges commented Jul 2, 2021

After 4.1.3 give Error. After 5.0.0 no Error, but return no symbols (server side).

I perform the actions according to the instructions. Can you update it then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants