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.

On 0.4, I'm getting `Module build failed: Error: A valid query string passed to parseQuery should begin with '?'`

See original GitHub issue
ERROR in ./shape-react-core/~/svg-react-loader/lib/loader.js?name=Icon!./shape-react-core/images/books.svg
Module build failed: Error: A valid query string passed to parseQuery should begin with '?'
    at Object.parseQuery (/Users/jameydeorio/dev/orm/frontend/node_modules/loader-utils/lib/parseQuery.js:13:9)
    at Object.svgReactLoader (/Users/jameydeorio/dev/orm/frontend/shape-react-core/node_modules/svg-react-loader/lib/loader.js:25:28)

Webpack config:

{
        test: /\.svg$/,
        exclude: /node_modules/,
        loader: 'svg-react'
      }

Import statement:

import Icon from 'svg-react?name=Icon!../../images/books.svg'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
kasperpihlcommented, Mar 29, 2017

I’ve just ran into the same issue. +1

0reactions
catamphetaminecommented, Jun 24, 2017

For anyone who read my previous comment about migrating to react-svg-loader – I’m migrating back to this library. The reason is that react-svg-loader feels less convenient (though to a small degree) and this library’s author has finally fixed this issue (even though the others remain).

UPDATE Migrating back to react-svg-loader because this library has a filename bug https://github.com/jhamlet/svg-react-loader/issues/72

Read more comments on GitHub >

github_iconTop Results From Across the Web

A valid query string passed to parseQuery should begin ...
Get the following error when building: Module build failed (from ./node_modules/ejs-compiled-loader/index.js): Error: A valid query string passed to ...
Read more >
npm error:A valid query string passed to parseQuery ...
js > Module build failed: Error: A valid query string passed to parseQuery should begin with '?' > at Object.parseQuery (D:\***\node_modules\_ ...
Read more >
A valid query string passed to parseQuery should begin ...
Get the following error when building: Module build failed (from ./node_modules/ejs-compiled-loader/index.js): Error: A valid query string ...
Read more >
[Solved]-npm error:A valid query string passed to parseQuery ...
Coding example for the question npm error:A valid query string passed to parseQuery should begin with '?'-Vue.js.
Read more >
loader-utils - npm
parseQuery. Parses a passed string (e.g. loaderContext.resourceQuery ) as a query string, and returns an object.
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