question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
fgnasscommented, May 2, 2016

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

0reactions
codesorter2015commented, Aug 7, 2018

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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: .indexOf is not a function - Stack Overflow
It is indeed a function - of a valid object - meaning time isn't a valid object. Make sure time exists, log it...
Read more >
TypeError: indexOf is not a function in JavaScript | bobbyhadz
The "indexOf is not a function" error occurs when the indexOf() method is called on a value that is not of type string...
Read more >
Node.js v19.3.0 Documentation
calls() and will throw an error for functions that have not been called the expected number of times. import assert from 'node:assert'; //...
Read more >
Uncaught TypeError: e.indexOf is not a function - WordPress.org
It gives me this error: Uncaught TypeError: e.indexOf is not a function. And the “I like” does not tell me anything, but it...
Read more >
String.prototype.lastIndexOf() - JavaScript - MDN Web Docs
The index of the last occurrence of searchString found, or -1 if not found. Description. Strings are zero-indexed: The index of a string's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found