rafaelklaessen/react-tradingview-widget

Cannot read property 'pop' of null

monaLeti opened this issue ยท 7 comments

I used the example in the readme and I got:

Cannot read property 'pop' of null

embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:33 Uncaught TypeError: Cannot read property 'pop' of null
at Object._decodeParams (embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:33)
at Object._decodeConnectionStatus (embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:34)
at Object._init (embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:33)
at embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:35
at Object. (embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:35)
at t (vendors_embed.4bfc5550ac7684c6ccbc.387511056d12.js:1)
at Object. (embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:366)
at Object. (embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:367)
at t (vendors_embed.4bfc5550ac7684c6ccbc.387511056d12.js:1)
at Object. (embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:657)
_decodeParams @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:33
_decodeConnectionStatus @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:34
_init @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:33
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:35
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:35
t @ vendors_embed.4bfc5550ac7684c6ccbc.387511056d12.js:1
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:366
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:367
t @ vendors_embed.4bfc5550ac7684c6ccbc.387511056d12.js:1
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:657
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:677
t @ vendors_embed.4bfc5550ac7684c6ccbc.387511056d12.js:1
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:632
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:656
t @ vendors_embed.4bfc5550ac7684c6ccbc.387511056d12.js:1
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:629
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:629
t @ vendors_embed.4bfc5550ac7684c6ccbc.387511056d12.js:1
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:734
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:738
t @ vendors_embed.4bfc5550ac7684c6ccbc.387511056d12.js:1
window.webpackJsonp @ vendors_embed.4bfc5550ac7684c6ccbc.387511056d12.js:1
(anonymous) @ embed_embed_widget.74238a8332aa3e992889.eabf67cb1366.js:1

I am using
Node: 8.9.1
React:16.2.0

Thanks! I'm planning on looking at server side rendering this afternoon, then I'll look at this issue too.
My guess is that I've made a mistake in the example, but I'm not sure ๐Ÿ˜„

I am not sure if it will be related with your module. I am checking. Letting you know what I figure it out ;)

@monaLeti @rafaelklaessen Did either of you ever find a fix for this error? I just encounter the same issue, and would love some insight

Nope, but if you could provide steps for reproduction, that would be really useful

@rafaelklaessen
I'm not sure if it's an issue with your package, or if tradingview changed something on their end, but result seems to be replicated in this codepen.

Uncaught TypeError: Cannot read property 'pop' of null
embed_widget.45dc9d1b9e07c94fa54e.js:316
at Object._decodeParams (embed_widget.45dc9d1b9e07c94fa54e.js:316)
at Object._decodeConnectionStatus (embed_widget.45dc9d1b9e07c94fa54e.js:318)
at Object._init (embed_widget.45dc9d1b9e07c94fa54e.js:316)
at embed_widget.45dc9d1b9e07c94fa54e.js:318
at Object.TxTq (embed_widget.45dc9d1b9e07c94fa54e.js:319)
at c (runtime.e42e9b488826e2eb365d.js:1)
at Object. (embed_widget.45dc9d1b9e07c94fa54e.js:246)
at Object.LBej (embed_widget.45dc9d1b9e07c94fa54e.js:247)
at c (runtime.e42e9b488826e2eb365d.js:1)
at Object. (embed_widget.45dc9d1b9e07c94fa54e.js:512)

The codepen has some additional errors (blocked by client), but I'm receiving the same error on our localhost, stage, and app sites (minus the "ERR_BLOCKED_BY_CLIENT" error), and the result is the same (an empty container with a spinning loading bar)

Here's the stripped down component to replicate the error in react:

import React from "react";
import TradingViewWidget, { Themes, BarStyles, IntervalTypes, RangeTypes} from "react-tradingview-widget";

const ChartPanel = () => {
  return (
      <TradingViewWidget
        symbol={`BINANCE:BTCUSDT`}
        locale="en"
        height={550}
        width={500}
        hide_side_toolbar={false}
        withdateranges={true}
        interval="D"
        timezone="Etc/PST"
        theme={Themes.LIGHT}
        style={"1"}
      />
  )
}

export default ChartPanel;

To be clear, I've had your tradingview-widget installed and working for months (it's great!), and am just encountering the error today - so I'm still trying to figure out sort out the root cause

@rafaelklaessen Ugh. Went down a rabbit hole when I should have just restarted Chrome. The error must have come from something weird in the browser cache, and it was working just fine in safari and mobile. After rebooting, it worked fine in chrome as well. Sorry for the diversion!

Ah, that's great to hear. Good to know this long-standing issue isn't one with the package itself.

Thank you for your effort and for tracking this down!