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

Node 6 - TypeError: mod.lastIndexOf is not a function #130

Closed
Alex0007 opened this issue May 1, 2016 · 8 comments
Closed

Node 6 - TypeError: mod.lastIndexOf is not a function #130

Alex0007 opened this issue May 1, 2016 · 8 comments

Comments

@Alex0007
Copy link

Alex0007 commented May 1, 2016

node-dev index.js 

/home/alex/.nvm/versions/node/v6.0.0/lib/node_modules/node-dev/lib/index.js:120
  var i = mod.lastIndexOf(n);
              ^

TypeError: mod.lastIndexOf is not a function
    at getPrefix (/home/alex/.nvm/versions/node/v6.0.0/lib/node_modules/node-dev/lib/index.js:120:15)
    at getLevel (/home/alex/.nvm/versions/node/v6.0.0/lib/node_modules/node-dev/lib/index.js:110:11)
    at /home/alex/.nvm/versions/node/v6.0.0/lib/node_modules/node-dev/lib/index.js:77:45
    at ChildProcess.handleMessage (/home/alex/.nvm/versions/node/v6.0.0/lib/node_modules/node-dev/lib/ipc.js:19:43)
    at emitTwo (events.js:111:20)
    at ChildProcess.emit (events.js:191:7)
    at handleMessage (internal/child_process.js:718:10)
    at Pipe.channel.onread (internal/child_process.js:444:11)

Node 6
OS: Linux

@fgnass
Copy link
Owner

fgnass commented May 1, 2016

Thank you! That's really strange. The tests pass on Travis CI under Node 6.0.0 – Would you mind quickly cloning the repo to see if npm i && npm test fails on your machine?

@Alex0007
Copy link
Author

Alex0007 commented May 1, 2016

Tests are passed.

Reproduce this error: https://github.com/Alex0007/node-dev-bug
Also i've checked Node 5 and error remains

@fgnass fgnass closed this as completed in fea0e9a May 2, 2016
@fgnass
Copy link
Owner

fgnass commented May 2, 2016

Thanks again! Fix published as part of v3.1.1.

@VietDucPhan
Copy link

The issue is still present in node 6.3

@fgnass
Copy link
Owner

fgnass commented Jul 29, 2016

Which version of node-dev are you using?

@VietDucPhan
Copy link

@fgnass I used 6.3.0 the last time i checked. but now when i check version or do node-dev.
it show

module.js:442
    throw err;
    ^

Error: Cannot find module 'clone'

yukpiz added a commit to yukpiz/node-dev that referenced this issue Dec 2, 2016
Prevent reference error when object is passed.
For it to work properly, it is mandatory to have a `filename` property.
@swapnil-tnex
Copy link

Node - v6.11.1
'TypeError: o.file.lastIndexOf is not a function' getting same error. OS is windows 10

@codesorter2015
Copy link

function getFileExtension(filename) {
return filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2);
}

I'm getting the following errors:
(node:21156) UnhandledPromiseRejectionWarning: TypeError: filename.lastIndexOf is not a function
at getFileExtension (F:\galaxy\app.js:227:37)

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