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.

Module build failed: Error: Non-whitespace before first tag.

See original GitHub issue
Module build failed: Error: Non-whitespace before first tag.
Line: 0
Column: 1
Char: m
    at error (/Users/chetcorcos/code/frog/node_modules/sax/lib/sax.js:667:10)
    at strictFail (/Users/chetcorcos/code/frog/node_modules/sax/lib/sax.js:693:7)
    at beginWhiteSpace (/Users/chetcorcos/code/frog/node_modules/sax/lib/sax.js:967:7)
    at Object.write (/Users/chetcorcos/code/frog/node_modules/sax/lib/sax.js:1019:11)
    at Parser.exports.Parser.Parser.parseString (/Users/chetcorcos/code/frog/node_modules/xml2js/lib/xml2js.js:503:31)
    at Parser.parseString (/Users/chetcorcos/code/frog/node_modules/xml2js/lib/xml2js.js:7:59)
    at parseXml (/Users/chetcorcos/code/frog/node_modules/svg-react-loader/index.js:23:15)
    at wrapper (/Users/chetcorcos/code/frog/node_modules/svg-react-loader/node_modules/lodash/internal/createPartialWrapper.js:38:15)
    at /Users/chetcorcos/code/frog/node_modules/svg-react-loader/index.js:92:9
    at /Users/chetcorcos/code/frog/node_modules/svg-react-loader/index.js:17:9
 @ ./src/ui/nav/index.js 13:12-37
webpack: bundle is now VALID.

here’s the svg:

<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><style>.st0{fill:#3AC98D;}</style><path d="M20 0C9 0 0 9 0 20s9 20 20 20 20-9 20-20S31 0 20 0zm2.7 26.3V16.1l-7.1 9-.1.2c-.5.6-1.3 1-2.1 1H10l1-1.2 3.4-4.3 7.4-9.3c.5-.7 1.4-1.1 2.4-1 1.4.2 2.4 1.3 2.4 2.7v13.2h-3.9z"/></svg>

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
ccorcoscommented, May 19, 2016

I ran into this 6 months ago apparently 😉

0reactions
imjasonmillercommented, Dec 18, 2017

I ran into this exact error as well, but caused it by omitting an include for my font loader, which allowed it to pick up other .svg files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Non-whitespace before first tag #84 - jhamlet/svg-react-loader
The problem is that the parser is literally coming across this string: module.exports = __webpack_public_path__ + " ...
Read more >
XML Loader - Module build failed: Error: Non-whitespace ...
Module build failed : Error: Non-whitespace before the first tag. Line: 0 Column: 1 Char: m. No matter which one I choose. My...
Read more >
How to parse XML from URL – problem with encoding
I get the data as a string but when I try to convert it to JSON (XML to JSON module), I am getting...
Read more >
Non-whitespace before first tag. Line: 0 Column: 1 Char: e 报错
Module build failed (from ./node_modules/@svgr/webpack/lib/index.js): Error: Expected > (0:538). If this is valid SVG, it's ...
Read more >
Bug? Webpack gives warnings for kendo-theme-material ...
I've generated a React app that uses TypeScript and only added kendo-theme-material and I get warnings when building the production build.
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