Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_this.getElementTextContentArray is not a function #16

Closed
mrvndss opened this issue Sep 30, 2020 · 4 comments
Closed

_this.getElementTextContentArray is not a function #16

mrvndss opened this issue Sep 30, 2020 · 4 comments

Comments

@mrvndss
Copy link

mrvndss commented Sep 30, 2020

The given example:

import * as rssParser from 'react-native-rss-parser';

return fetch('http://www.nasa.gov/rss/dyn/breaking_news.rss')
  .then((response) => response.text())
  .then((responseData) => rssParser.parse(responseData))
  .then((rss) => {
    console.log(rss.title);
    console.log(rss.items.length);
  });

results in this error:

_this.getElementTextContentArray is not a function. (In '_this.getElementTextContentArray(node, tagName, namespace)', '_this.getElementTextContentArray' is undefined)
- node_modules/react-native-rss-parser/parsers/utils.js:40:32 in exports.getElementTextContent
- node_modules/react-native-rss-parser/parsers/atomv1.js:5:6 in <global>
- node_modules/react-native-rss-parser/parsers/atomv1.js:135:9 in mapChannelFields
- node_modules/react-native-rss-parser/parsers/atomv1.js:169:8 in exports.parse
* http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:145220:35 in <unknown>
- node_modules/react-native/node_modules/promise/setimmediate/core.js:45:6 in tryCallTwo
- node_modules/react-native/node_modules/promise/setimmediate/core.js:200:22 in doResolve
- node_modules/react-native/node_modules/promise/setimmediate/core.js:66:11 in Promise
- node_modules/react-native-rss-parser/index.js:22:16 in exports.parse
- node_modules/react-native/node_modules/promise/setimmediate/core.js:37:13 in tryCallOne
- node_modules/react-native/node_modules/promise/setimmediate/core.js:123:24 in setImmediate$argument_0
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:130:14 in _callTimer
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:181:14 in _callImmediatesPass
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:441:30 in callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:387:6 in __callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:135:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:364:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:134:4 in flushedQueue
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

Update: It's working in v1.4.0

@jameslawler
Copy link
Owner

I just tried it out using expo as per your stack trace and it works fine for me.
I also just saw your edit saying that it works in v1.4.0 and so I will close this issue. 👍

@nilde
Copy link

nilde commented Oct 8, 2020

Had the same issue here with version 1.5.0:
Solved changing the following lines of utils.js file.

Line 31 from:
const nodes = this.getChildElements(node, tagName, namespace);
to
const nodes = exports.getChildElements(node, tagName, namespace);

and line 41 from:
const array = this.getElementTextContentArray(node, tagName, namespace);
to
const array = exports.getElementTextContentArray(node, tagName, namespace);

@julianbragachi
Copy link
Contributor

I'm having same issue in 1.4.0 and 1.5.0.

jameslawler added a commit that referenced this issue Oct 21, 2020
Update utils.js to fix not a function issue #16
@jameslawler
Copy link
Owner

Thanks for the fix from @julianbragachi
I have updated npm with v1.5.1

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

No branches or pull requests

4 participants