Skip to content

TypeError: i is null / TypeError: Cannot read property 'split' of null #25

@rotsee

Description

@rotsee

I get an error Uncaught TypeError: Cannot read property 'split' of null in Chrome, and TypeError: i is null [Learn More] in Firefox, given the following code:

<svg data-src="/images/test.svg" id="test"></svg>

document.addEventListener('DOMContentLoaded', function() {
  var elementsToInject = document.querySelectorAll('svg[data-src]');
  console.log(elementsToInject);
  # [svg#test]
  var injector = new SVGInjector();
  console.log(injector);
  # [svg#test]
  # n {}
  # XHR finished loading: GET "http://localhost:3000/images/test.svg".

  injector.inject(elementsToInject);
});

Any ideas how to trobleshoot this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions