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.

Cannot read property 'slice' of undefined

See original GitHub issue
OliverSalzburg@Oliver-PC MINGW64 ~/Projects/absync (dev)
$ karma init karma.conf.js
> readline.js:525
  this.line = this.line.slice(this.cursor);
                       ^

TypeError: Cannot read property 'slice' of undefined
    at Interface._deleteLineLeft (readline.js:525:24)
    at suggestNextOption (C:\Users\Oliver\Projects\absync\node_modules\karma\lib\init\state_machine.js:43:9)
    at nextQuestion (C:\Users\Oliver\Projects\absync\node_modules\karma\lib\init\state_machine.js:119:12)
    at process (C:\Users\Oliver\Projects\absync\node_modules\karma\lib\init\state_machine.js:135:10)
    at Object.exports.init (C:\Users\Oliver\Projects\absync\node_modules\karma\lib\init.js:247:6)
    at Object.exports.run (C:\Users\Oliver\Projects\absync\node_modules\karma\lib\cli.js:237:25)
    at requireCliAndRun (C:\Users\Oliver\AppData\Roaming\npm\node_modules\karma-cli\bin\karma:44:16)
    at C:\Users\Oliver\AppData\Roaming\npm\node_modules\karma-cli\bin\karma:54:12
    at C:\Users\Oliver\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:44:21
    at ondir (C:\Users\Oliver\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:187:31)
    at C:\Users\Oliver\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:153:39
    at onex (C:\Users\Oliver\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:93:22)
    at C:\Users\Oliver\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:24:18
    at FSReqWrap.oncomplete (fs.js:82:15)

I just installed karma and tried to init a new configuration. Seems to be a problem with MINGW. The command works in the default Command Prompt.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:2
  • Comments:21 (3 by maintainers)

github_iconTop GitHub Comments

14reactions
godzillaladcommented, Apr 23, 2018

Workaround that works nicely in GIT BASH shell is to call it directly using node

node node_modules/karma/bin/karma init

8reactions
edyseguracommented, Jun 10, 2016

I could ran this command (karma init) in windows using windows command line instead of MINGW.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with error Cannot read property 'slice' of undefined
I faced the same error today, and solved it by initializing the array to an empty array before performing any slice ...
Read more >
Cannot read property 'slice' of undefined error when trying to ...
Hi guys, As the title says, I am getting a Cannot read property 'slice' of undefined error in the console when trying to...
Read more >
TypeError: Cannot read property 'slice' of undefined - Support
Hello, I encountered the same problem with the new version solc compiler. Error:
Read more >
TypeError: Cannot read property 'slice' of undefined - MongoDB
So you can not retrieve that token because there is no Header so there is undefined variable. You are trying to slice that...
Read more >
Cannot read property 'slice' of undefined version in new project
js): TypeError: Cannot read property 'slice' of undefined at throwVersionError (node_modules/@babel/helper-plugin-utils/lib/index.js:62:15) at ...
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