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

Type Error: Textract is not a function #6

Open
kittureddy123 opened this issue Jan 22, 2018 · 11 comments
Open

Type Error: Textract is not a function #6

kittureddy123 opened this issue Jan 22, 2018 · 11 comments

Comments

@kittureddy123
Copy link

Hi Team,
I am running the resume parser in windows platform, i am getting the following error

\code4goal-resume-parser-master\src\libs\processing.js:51
textract(file, {preserveLineBreaks: true}, function(err, data) {
^
TypeError: textract is not a function
at extractText (e:\code4goal-resume-parser-master\src\libs\processing.js:51:3)
at Object.processFile [as run] (e:\code4goal-resume-parser-master\src\libs\processing.js:15:3)
at e:\code4goal-resume-parser-master\src\ParseBoy.js:27:16
at Function..each..forEach (e:\code4goal-resume-parser-master\node_modules\underscore\underscore.js:153:9)
at ParseBoy.willHelpWithPleasure (e:\code4goal-resume-parser-master\src\ParseBoy.js:26:4)
at SomeHR. (e:\code4goal-resume-parser-master\app.js:36:14)
at e:\code4goal-resume-parser-master\src\SomeHR.js:35:21
at FSReqWrap.oncomplete (fs.js:135:15)

I have installed below version dependencies
"request": "^2.53.0",
"textract": "^2.2.0",
"underscore": "^1.8.3"

@likerRr
Copy link
Owner

likerRr commented Feb 4, 2018

Sorry, at the moment I'm not supporting this project. But it's planned in the near future

@ramvemula
Copy link

Change the line no 51 in processing.js as below to solve this issue.
textract.fromFileWithPath(file, {preserveLineBreaks: true}, function(err, data) {

@likerRr
Copy link
Owner

likerRr commented Mar 20, 2018

@ramvemula this is because resume-parser requires textract@0.19.0, but seems like you are using textract@v2+. Did you manually install textract?

@ramvemula
Copy link

Yes, I manually installed textract@v2 to fix the other issues like extractors not installed for type doc, docx, pdf etc.
After that I was getting this Type Error : textract is not a function. So I fixed this issue by changing the line 51 in processing.js

@likerRr
Copy link
Owner

likerRr commented Mar 20, 2018

I know, there are a lot of issues in resume-parser, but I don't have time to fix them.

I pushed a new branch called ce. Please, read some instructions here. If you have a PR which solves some issues - please welcome to push it.

@likerRr likerRr closed this as completed Mar 20, 2018
@monicaguduru
Copy link

Change the line no 51 in processing.js as below to solve this issue.
textract.fromFileWithPath(file, {preserveLineBreaks: true}, function(err, data) {

I am getting this error when I changed line no 51:

HR manager:

  • My stack for today are: .gitkeep, ErnaniJoppert P Martins.pdf, Monica_Guduru_Resume.pdf, resume.html, resume.txt
    Parse Boy:
  • Hi, i can help you with .gitkeep, ErnaniJoppert P Martins.pdf, Monica_Guduru_Resume.pdf, resume.html, resume.txt
    Error: Incorrect parameters passed to textract.
    at returnArgsError (C:\Users\monica\Desktop\code4goal-resume-parser\node_modules\textract\lib\index.js:36:15)
    at fromFileWithMimeAndPath (C:\Users\monica\Desktop\code4goal-resume-parser\node_modules\textract\lib\index.js:79:5)
    at Object.fromFileWithPath (C:\Users\monica\Desktop\code4goal-resume-parser\node_modules\textract\lib\index.js:88:5)
    at extractText (C:\Users\monica\Desktop\code4goal-resume-parser\src\libs\processing.js:51:12)
    at Object.processFile [as run] (C:\Users\monica\Desktop\code4goal-resume-parser\src\libs\processing.js:15:3)
    at C:\Users\monica\Desktop\code4goal-resume-parser\src\ParseBoy.js:27:16
    at Function.
    .each._.forEach (C:\Users\monica\Desktop\code4goal-resume-parser\node_modules\underscore\underscore.js:186:9)
    at ParseBoy.willHelpWithPleasure (C:\Users\monica\Desktop\code4goal-resume-parser\src\ParseBoy.js:26:4)
    at SomeHR. (C:\Users\monica\Desktop\code4goal-resume-parser\app.js:36:14)
    at C:\Users\monica\Desktop\code4goal-resume-parser\src\SomeHR.js:35:21
    (node:15744) [DEP0026] DeprecationWarning: util.print is deprecated. Use console.log instead.
  • I'm working with "resume.html" now
  • I'm working with "resume.txt" now
  • I'm working with "ErnaniJoppert P Martins.pdf" now
  • I'm working with "Monica_Guduru_Resume.pdf" now
    null
    null
    null

Can you please look into it?

@likerRr
Copy link
Owner

likerRr commented Jun 10, 2019

@monicaguduru have you manually installed textract@v2 alongside with changing the code?

@monicaguduru
Copy link

@likerRr Yeah. I had the same problem so I changed the line and installed it again. But now I am getting another error quoted above. It is returning all null values. Also, I installed textract@0.19.0 as you said in the previous comment, but this did not help.

@monicaguduru
Copy link

@likerRr @ramvemula I am not able to fix this issue.

@likerRr
Copy link
Owner

likerRr commented Jun 14, 2019

@monicaguduru can you debug that error yourself? I mean, can you find, what exactly prints null? And if it's possible to add a link to line of code from github.

As mentioned in the readme file, that repo is not maintained at the moment at all. So i can't operatively solve your issue, sorry.

@likerRr likerRr reopened this Jun 14, 2019
@fadiajabeen
Copy link

To reslove "Error: Incorrect parameters passed to textract."
edit processing.js line 51 like this
textract.fromFileWithPath(path.resolve(file), {preserveLineBreaks: true}, function(err, data) {
because when I printed the file, each path had some forward some backward slashes.
Plus I deleted .gitkeep file from public folder from which all files are picked for parsing. Now its working.

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

5 participants