Broadway icon indicating copy to clipboard operation
Broadway copied to clipboard

Uncaught TypeError: Cannot read property 'slice' of null

Open znalbert opened this issue 6 years ago • 5 comments

Try to use this, but I'm getting Uncaught TypeError: Cannot read property 'slice' of null from var parsed = jsfunc.toString().match(sourceRegex).slice(1); in Decoder.js. Any idea what's going on? Any help would be much appreciated.

znalbert avatar May 24 '18 19:05 znalbert

same problem here

sijakret avatar Jun 21 '18 13:06 sijakret

does the problem ocur on the demo page linked on the main page?

soliton4 avatar Jun 21 '18 13:06 soliton4

no, there it works. in my setup I am loading the decoder through webpack, so there is a chance that somehow there is mangeling by webpack/babel that introduces the problem.

do you have any hints?

sijakret avatar Jun 21 '18 13:06 sijakret

image

sijakret avatar Jun 21 '18 14:06 sijakret

the whole problem seems to be related to the module format and bundling. this is how i could use the Decoder in an ES6/webpack app:

  • install npm package (broadwayjs) - does not work out of the box.
  • patch node_modules/broadwayjs/Player/Decoder.js (replace var Decoder in first line by export default)

i am aware that this is not a sustainable way of doing it..

sijakret avatar Jun 21 '18 14:06 sijakret