Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Uncaught TypeError: text.slice is not a function #316

Open
lucasdauto opened this issue Oct 19, 2018 · 3 comments
Open

Uncaught TypeError: text.slice is not a function #316

lucasdauto opened this issue Oct 19, 2018 · 3 comments

Comments

@lucasdauto
Copy link

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.31.2 x64
Electron: 2.0.7
OS: Unknown Windows version
Thrown From: atom-ide-ui package 0.13.0

Stack Trace

Uncaught TypeError: text.slice is not a function

At C:\Users\x036053\.atom\packages\atom-ide-ui\node_modules\rxjs\bundles\Rx.min.js:71

TypeError: text.slice is not a function
    at parseText (/packages/atom-ide-ui/modules/atom-ide-ui/pkg/atom-ide-console/lib/parseText.js:120:20)
    at RecordView._renderContent (/packages/atom-ide-ui/modules/atom-ide-ui/pkg/atom-ide-console/lib/ui/RecordView.js:217:72)
    at RecordView.render (/packages/atom-ide-ui/modules/atom-ide-ui/pkg/atom-ide-console/lib/ui/RecordView.js:288:13)
    at Kg (/packages/atom-ide-ui/node_modules/react-dom/cjs/react-dom.production.min.js:167:226)
    at Rg (/packages/atom-ide-ui/node_modules/react-dom/cjs/react-dom.production.min.js:180:75)
    at xh (/packages/atom-ide-ui/node_modules/react-dom/cjs/react-dom.production.min.js:202:22)
    at yh (/packages/atom-ide-ui/node_modules/react-dom/cjs/react-dom.production.min.js:203:234)
    at Vh (/packages/atom-ide-ui/node_modules/react-dom/cjs/react-dom.production.min.js:212:353)
    at Yh (/packages/atom-ide-ui/node_modules/react-dom/cjs/react-dom.production.min.js:211:278)
    at Wh (/packages/atom-ide-ui/node_modules/react-dom/cjs/react-dom.production.min.js:211:113)
    at Ah (/packages/atom-ide-ui/node_modules/react-dom/cjs/react-dom.production.min.js:209:281)
    at og (/packages/atom-ide-ui/node_modules/react-dom/cjs/react-dom.production.min.js:207:333)
    at Object.enqueueSetState (/packages/atom-ide-ui/node_modules/react-dom/cjs/react-dom.production.min.js:148:225)
    at Object.F.setState (/packages/atom-ide-ui/node_modules/react/cjs/react.production.min.js:12:357)
    at /packages/atom-ide-ui/modules/nuclide-commons-ui/bindObservableAsProps.js:46:14)
    at a.__tryOrUnsub (/packages/atom-ide-ui/node_modules/rxjs/bundles/Rx.min.js:71:208)
    at a.next (/packages/atom-ide-ui/node_modules/rxjs/bundles/Rx.min.js:70:63)
    at a._next (/packages/atom-ide-ui/node_modules/rxjs/bundles/Rx.min.js:68:217)
    at a.next (/packages/atom-ide-ui/node_modules/rxjs/bundles/Rx.min.js:67:406)
    at a._next (/packages/atom-ide-ui/node_modules/rxjs/bundles/Rx.min.js:136:208)
    at a.next (/packages/atom-ide-ui/node_modules/rxjs/bundles/Rx.min.js:67:406)
    at a.clearThrottle (/packages/atom-ide-ui/node_modules/rxjs/bundles/Rx.min.js:208:371)
    at a.notifyNext (/packages/atom-ide-ui/node_modules/rxjs/bundles/Rx.min.js:208:427)
    at a._next (/packages/atom-ide-ui/node_modules/rxjs/bundles/Rx.min.js:90:52)
    at a.next (/packages/atom-ide-ui/node_modules/rxjs/bundles/Rx.min.js:67:406)
    at requestAnimationFrame (/packages/atom-ide-ui/modules/nuclide-commons/observable.js:445:14)

Commands

     -7:49.9.0 editor:select-to-first-character-of-line (input.hidden-input)
     -7:46.9.0 core:delete (input.hidden-input)
  2x -7:42.7.0 core:backspace (input.hidden-input)
     -7:40.8.0 core:move-down (input.hidden-input)
  2x -5:49.2.0 debugger:show (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
     -4:52.1.0 editor:newline (input.hidden-input)
     -4:50.6.0 core:undo (input.hidden-input)
  2x -4:49.2.0 core:save (input.hidden-input)
     -3:31 core:backspace (input.hidden-input)
     -3:30.2.0 core:save (input.hidden-input)
     -3:02.3.0 core:move-down (input.hidden-input)
  5x -2:59.7.0 core:move-up (input.hidden-input)
     -2:50 core:save (input.hidden-input)
  4x -2:05.2.0 core:backspace (input.hidden-input)
 81x -1:49.1.0 core:select-left (input.hidden-input)
     -1:44.8.0 core:copy (input.hidden-input)

Non-Core Packages

angularjs 0.5.3 
angularjs-snippets 0.10.18 
atom-debug-ui 1.0.4 
atom-ide-ui 0.13.0 
atom-live-server 2.3.0 
emmet 2.4.3 
git-status 0.3.4 
ide-php 0.7.15 
php-debug 0.3.5 
php-server 0.8.0 
@matthewwithanm
Copy link
Contributor

Thanks for the report @lucasdauto! We'll look into this next week (:

@captbaritone
Copy link
Contributor

This is odd. From what I can tell, text is guaranteed to be a string. In fact, we even check for a falsy value or empty string and ensue it's a non empty string here: https://github.com/facebook-atom/atom-ide-ui/blob/master/modules/atom-ide-ui/pkg/atom-ide-console/lib/ui/RecordView.js#L94

I guess that means that text must be both truthy and not a string. I don't immediately see how that could be the case.

@edjubuh
Copy link

edjubuh commented Nov 5, 2018

This is odd. From what I can tell, text is guaranteed to be a string. In fact, we even check for a falsy value or empty string and ensue it's a non empty string here: https://github.com/facebook-atom/atom-ide-ui/blob/master/modules/atom-ide-ui/pkg/atom-ide-console/lib/ui/RecordView.js#L94

I guess that means that text must be both truthy and not a string. I don't immediately see how that could be the case.

I ran into this issue as well. I caused it by calling console.error(anExceptionObject) (pseudocode), and seeing how it'd come out. anExceptionObject would be truthy and not a string. I should have done console.error(anExceptionObject.toString(). log and friends expect a string input. This was mostly caused on my end by not looking at the expected types, but the note about only allowing string or falsey input wasn't in the formal documentation.

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

No branches or pull requests

4 participants