Skip to content
This repository has been archived by the owner on Jun 12, 2019. It is now read-only.

domParser.parseFromString is not a function #6

Open
bbarker opened this issue Apr 11, 2019 · 1 comment
Open

domParser.parseFromString is not a function #6

bbarker opened this issue Apr 11, 2019 · 1 comment

Comments

@bbarker
Copy link
Contributor

bbarker commented Apr 11, 2019

Hello,

Just trying out this library at the newly released version 4.0.0, and got this error when run as a test in a browser (Firefox or Chromium):

  ☠ Failed: note.xml because domParser.parseFromString is not a function

My test code uses the unit test package, and I don't think the xml content string noteXml is relevant for this issue:

module Test.Main where

import Prelude

import Effect                          (Effect)
import Effect.Class                    (liftEffect)
-- import Effect.Console                  (log)

import Test.Data                       as TD
import Test.Unit                       (suite, test)
import Test.Unit.Main                  (runTest)
import Test.Unit.Assert                as Assert

import Web.DOM.Document                (Document)
import Web.DOM.DOMParser               (DOMParser, makeDOMParser, parseXMLFromString)

parseNoteDoc :: DOMParser -> Document
parseNoteDoc dp = parseXMLFromString TD.noteXml dp

main :: Effect Unit
main = runTest do
  suite "non-namespaced tests" do
    test "note.xml" do
      domParser <- liftEffect $ makeDOMParser
      note <- pure $ parseNoteDoc domParser

Is there something else that needs to be done to use this library? Thanks,

@bbarker
Copy link
Contributor Author

bbarker commented Apr 12, 2019

I essentially copied this into #7 - you can use npm run testbrowser and open dist/index.html to see the error in the console.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant