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.

<svg> attribute width: Expected length, "NaNpx"

See original GitHub issue

Quite a lot err in console. And my Code:

import VueBarcode from 'vue-barcode'
<vue-barcode value="123456"></vue-barcode>
setSvgAttributes @ svg.js?83f5:144
prepareSVG @ svg.js?83f5:64
render @ svg.js?83f5:36
render @ JsBarcode.js?a07e:227
API.render @ JsBarcode.js?a07e:206
JsBarcode @ JsBarcode.js?a07e:76
render @ index.js?8f42:41
Vue.$watch @ vue.esm.js?65d7:3367
mounted @ index.js?8f42:32
callHook @ vue.esm.js?65d7:2665
insert @ vue.esm.js?65d7:3526
invokeInsertHook @ vue.esm.js?65d7:5469
patch @ vue.esm.js?65d7:5639
Vue._update @ vue.esm.js?65d7:2414
updateComponent @ vue.esm.js?65d7:2538
get @ vue.esm.js?65d7:2881
Watcher @ vue.esm.js?65d7:2870
mountComponent @ vue.esm.js?65d7:2542
Vue$3.$mount @ vue.esm.js?65d7:7863
Vue$3.$mount @ vue.esm.js?65d7:10066
Vue._init @ vue.esm.js?65d7:4236
Vue$3 @ vue.esm.js?65d7:4321
(anonymous) @ main.js?1c90:25
(anonymous) @ app.js:1245
__webpack_require__ @ app.js:660
fn @ app.js:86
(anonymous) @ app.js:2509
__webpack_require__ @ app.js:660
(anonymous) @ app.js:709
(anonymous) @ app.js:712
svg.js?83f5:148 Error: <svg> attribute viewBox: Expected number, "0 0 NaN 0".
setSvgAttributes @ svg.js?83f5:148
prepareSVG @ svg.js?83f5:64
render @ svg.js?83f5:36
render @ JsBarcode.js?a07e:227
.......
(anonymous) @ app.js:709
(anonymous) @ app.js:712
svg.js?83f5:175 Error: <rect> attribute x: Expected length, "NaN".```

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lindellcommented, Sep 9, 2017

Updated the package in npm now

0reactions
wparadcommented, Nov 19, 2017

I was having the same problem, turns out that I was binding a string to the property value

<barcode width="1">

instead of binding the int value

<barcode :width="1">
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: <rect> attribute width: Expected length, "NaN". and <text ...
So when I want to call the code, I think it should be used like this in my pasted code: var texts =...
Read more >
Error: <svg> attribute height: Expected length, "auto". #194
I get this console error Error: <svg> attribute height: Expected length, "auto". in Chrome, despite I've set the height to auto , in...
Read more >
Error: <rect> attribute width: Expected length, "NaN" - Highcharts
The reason why you get this error is that there is a bug in the Higcharts Stock code which don't allow to initialize...
Read more >
d3.v3.min.js:1 Error: <svg> attribute height - Google Groups
But when i am clicking that graph to load a bigger chart in viewbox , i am getting an error d3.v3.min.js:1 Error: attribute...
Read more >
[Solved]-Error: <rect> attribute x: Expected length, "NaN"-d3.js
[Solved]-Error: <rect> attribute x: Expected length, "NaN"-d3.js · When creating your xScale you are passing strings not Date objects. Instead, you need to...
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