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

Uncaught Error: This API only accepts integers #57

Closed
chelombiev opened this issue Apr 20, 2020 · 12 comments
Closed

Uncaught Error: This API only accepts integers #57

chelombiev opened this issue Apr 20, 2020 · 12 comments
Labels
unable to duplicate !! When the issue cannot be duplicated xterm-bug 🐛 bug with a related issue in xterm.js

Comments

@chelombiev
Copy link

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.45.0 x64
Electron: 4.2.7
OS: Mac OS X 10.15.4
Thrown From: x-terminal package 8.1.6

Stack Trace

Uncaught Error: This API only accepts integers

At /Users/kvad/.atom/packages/x-terminal/node_modules/xterm/lib/xterm.js:1

Error: This API only accepts integers
    at /packages/x-terminal/node_modules/xterm/lib/xterm.js:1:55468
    at Array.forEach (<anonymous>)
    at e._verifyIntegers (/packages/x-terminal/node_modules/xterm/lib/xterm.js:1:55412)
    at e.resize (/packages/x-terminal/node_modules/xterm/lib/xterm.js:1:52749)
    at e.fit (/packages/x-terminal/node_modules/xterm-addon-fit/lib/xterm-addon-fit.js:1:1704)
    at HTMLElement.refitTerminal (/packages/x-terminal/src/element.js:692:18)
    at HTMLElement.applyPendingTerminalProfileOptions (/packages/x-terminal/src/element.js:679:9)
    at IntersectionObserver.terminalDivIntersectionObserver.IntersectionObserver.root (/packages/x-terminal/src/element.js:107:10)

Commands

Non-Core Packages

atom-beautify 0.33.4 
autocomplete-js-import 1.4.0 
busy-signal 2.0.1 
color-picker 2.3.0 
emmet 2.4.3 
intentions 1.1.5 
linter 2.3.1 
linter-ui-default 1.8.1 
react-autocomplete 1.2.0 
terminal-plus 0.14.5 
x-terminal 8.1.6 
@UziTech
Copy link
Member

UziTech commented Apr 20, 2020

Can you please provide the steps you executed to reproduce this error?

@UziTech UziTech added the waiting on user feedback 📣 When waiting for a reply from user label Apr 20, 2020
@the-j0k3r
Copy link
Member

Ive come across this error, simply in the xterm API https://xtermjs.org/docs/api/terminal/interfaces/iterminaloptions/#properties enter some wrong value, some of the options draw this error when misconfigured.

@aminya
Copy link
Contributor

aminya commented Jul 27, 2020

I have gotten this a couple of times so far. Some times rerunning x-terminal:open or reloading Atom helps:

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.49.0 x64
Electron: 5.0.13
OS: Microsoft Windows 10 Enterprise
Thrown From: x-terminal package 9.0.1

Stack Trace

Uncaught Error: This API only accepts integers

At C:\Users\yahyaaba\Documents\GitHub\JavaScript\x-terminal\node_modules\xterm\lib\xterm.js:1

Error: This API only accepts integers
    at e._verifyIntegers (~/Documents/GitHub/JavaScript/x-terminal/node_modules/xterm/lib/xterm.js:1:101386)
    at e.resize (~/Documents/GitHub/JavaScript/x-terminal/node_modules/xterm/lib/xterm.js:1:98497)
    at e.fit (~/Documents/GitHub/JavaScript/x-terminal/node_modules/xterm-addon-fit/lib/xterm-addon-fit.js:1:1723)
    at HTMLElement.refitTerminal (~/Documents/GitHub/JavaScript/x-terminal/src/element.js:672:18)
    at HTMLElement.applyPendingTerminalProfileOptions (~/Documents/GitHub/JavaScript/x-terminal/src/element.js:659:9)
    at IntersectionObserver.terminalDivIntersectionObserver.IntersectionObserver.root (~/Documents/GitHub/JavaScript/x-terminal/src/element.js:107:10)
C:\Users\yahyaaba\Documents\GitHub\JavaScript\x-terminal\node_modules\xterm\lib\xterm.js:1 Uncaught Error: This API only accepts integers
    at e._verifyIntegers (C:\Users\yahyaaba\Documents\GitHub\JavaScript\x-terminal\node_modules\xterm\lib\xterm.js:1)
    at e.resize (C:\Users\yahyaaba\Documents\GitHub\JavaScript\x-terminal\node_modules\xterm\lib\xterm.js:1)
    at e.fit (C:\Users\yahyaaba\Documents\GitHub\JavaScript\x-terminal\node_modules\xterm-addon-fit\lib\xterm-addon-fit.js:1)
    at HTMLElement.refitTerminal (element.js:672)
    at element.js:98
    at callListenerProxy (VM928 C:\Users\yahyaaba\Documents\GitHub\JavaScript\@minimap\minimap-plus\node_modules\element-resize-detector\src\element-resize-detector.js:155)
    at utils.forEach (VM929 C:\Users\yahyaaba\Documents\GitHub\JavaScript\@minimap\minimap-plus\node_modules\element-resize-detector\src\collection-utils.js:14)
    at onResizeCallback (VM928 C:\Users\yahyaaba\Documents\GitHub\JavaScript\@minimap\minimap-plus\node_modules\element-resize-detector\src\element-resize-detector.js:154)
    at VM940 C:\Users\yahyaaba\Documents\GitHub\JavaScript\@minimap\minimap-plus\node_modules\element-resize-detector\src\detection-strategy\scroll.js:538
    at utils.forEach (VM929 C:\Users\yahyaaba\Documents\GitHub\JavaScript\@minimap\minimap-plus\node_modules\element-resize-detector\src\collection-utils.js:14)
    at notifyListenersIfNeeded (VM940 C:\Users\yahyaaba\Documents\GitHub\JavaScript\@minimap\minimap-plus\node_modules\element-resize-detector\src\detection-strategy\scroll.js:537)
    at VM940 C:\Users\yahyaaba\Documents\GitHub\JavaScript\@minimap\minimap-plus\node_modules\element-resize-detector\src\detection-strategy\scroll.js:505
    at Object.process (VM936 C:\Users\yahyaaba\Documents\GitHub\JavaScript\@minimap\minimap-plus\node_modules\batch-processor\src\batch-processor.js:124)
    at processBatch (VM936 C:\Users\yahyaaba\Documents\GitHub\JavaScript\@minimap\minimap-plus\node_modules\batch-processor\src\batch-processor.js:37)

Commands

     -0:55.5.0 typescript:activate (atom-workspace.workspace.scrollbars-visible-always.theme-atom-dark-syntax.theme-one-dark-ui)
     -0:38.6.0 command-palette:toggle (input.hidden-input)
     -0:36.7.0 core:confirm (input.hidden-input)
     -0:36.7.0 x-terminal:open (input.hidden-input)

Non-Core Packages

ascii-hex 0.2.0 
atom-alignment 0.13.0 
atom-bash 1.1.1 
atom-beautify 0.33.4 
atom-commander 0.12.0 
atom-console 0.4.6 
atom-ide-base 1.1.1 
atom-ide-datatip 0.13.2 
atom-ide-definitions 0.3.5 
atom-ide-hyperclick 1.0.3 
atom-ide-javascript 1.2.1 
atom-ide-julia 0.1.0 
atom-ide-markdown-service 1.3.0 
atom-ide-outline 1.9.4 
atom-ide-signature-help 0.8.0 
atom-ide-ui 0.13.0 
indent-detective 0.4.0 
atom-material-ui 2.1.3 
atom-matlab-editor 0.4.0 
atom-minify 0.8.0 
atom-reverser 3.0.4 
atom-terminal 0.8.0 
atom-typescript 13.9.2 
atomic-management 0.3.1 
atomizr 0.23.2 
auto-fold 0.4.0 
autocomplete 0.47.0 
autocomplete-bash-builtins 0.3.5 
autocomplete-clang 0.13.1 
autocomplete-en-en 0.2.0 
autocomplete-paths 2.12.2 
build 0.70.0 
build-npm-apm 0.12.0 
busy-signal 2.0.1 
clean-context-menu 0.3.2 
colorful-json 1.1.0 
cson-parser 0.1.0 
ctags-status 1.4.0 
file-icons 2.1.42 
find-trailing-whitespace 0.1.0 
fold-functions 0.11.0 
fold-lines 0.2.2 
font-viewer 0.4.0 
glow undefined 
hey-pane undefined 
highlight-selected 0.17.0 
Hydrogen 2.14.4 
hyperclick 0.1.5 
ide-bash 1.0.11 
ide-c-cpp 0.1.0 
ide-clangd 0.4.0 
ide-css 0.3.4 
ide-json 0.2.1 
ide-powershell 0.1.0 
ide-python 1.5.0 
ide-typescript 0.9.1 
ide-yaml 0.7.0 
ide-yml 0.7.8-0 
intentions 1.1.5 
javascript-drag-import 0.1.13 
javascript-refactor 0.7.1 
json-converter 0.2.4 
juno-plus 0.12.2 
keyword-pair-matcher 0.2.1 
kite 0.185.0 
language-autohotkey2 1.0.1 
language-cmake 1.2.0 
language-github-actions 0.1.0 
language-julia 0.19.3 
language-latex 1.2.0 
language-matlab 0.2.1 
language-matlab-octave 1.0.5 
language-matlab-plus 1.12.0 
language-pfm 0.82.0 
language-powershell 5.0.0 
language-reg 0.0.0 
latex-autocomplete 1.1.1 
latex-completions 0.3.6 
latex-friend 0.0.11 
latex-image-paste 0.5.0 
latex-itemizer 1.1.1 
latex-tree 0.5.0 
latex-wordcount 0.6.0 
less-than-slash 0.19.0 
linter 2.3.1 
linter-clang 4.1.2 
linter-cpplint 2.1.0 
linter-eslint 8.5.5 
linter-gcc 0.9.0 
linter-gcc2 0.8.8 
linter-julia 0.8.3 
linter-matlab 1.3.0 
linter-shellcheck 1.6.0 
linter-spell 0.15.0 
linter-spell-javascript 0.9.0 
linter-spell-latex 0.11.0 
linter-tslint 1.10.43 
linter-ui-default 1.8.1 
markdown-writer 2.11.10 
menu-manager 0.6.0 
minimap-find-and-replace 4.5.2 
minimap-highlight-selected 4.6.1 
minimap-lens 0.7.0 
minimap-linter 2.2.1 
minimap-plus 4.30.2 
multi-copy 0.1.0 
multi-cursor-plus 1.2.0 
multi-line-editor 1.6.0 
multi-paste2 0.4.1 
package-ts-generator 0.1.2 
pdf-view 0.72.0 
preview 0.19.0 
preview-inline 1.5.1 
project-manager 3.3.8 
Quick-JavaScript 2.2.0 
script 3.26.0 
snippet-generator-plus 0.1.2 
split-diff 1.6.1 
string-encoder 0.2.0 
Sublime-Style-Column-Selection 1.7.5 
symbols-tree-nav 0.15.5 
sync-settings 4.3.8 
teletype 0.13.4 
tool-bar 1.3.0 
trailing-spaces 0.4.0 
tree-view-git-status 1.5.3 
turbo-javascript 1.4.0 
uber-juno 0.3.0 
vim-mode-plus 1.36.4 
web-view 3.0.0 
x-terminal 9.0.1 

@UziTech
Copy link
Member

UziTech commented Jul 28, 2020

This looks like an issue in xterm.

It is this call to .fit() that causes the issue

https://github.com/bus-stop/x-terminal/blob/master/src/element.js#L672

It seems like it is a problem when .proposeDimensions() returns Infinity

https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-fit/src/FitAddon.ts#L35

@UziTech UziTech added xterm-bug 🐛 bug with a related issue in xterm.js and removed waiting on user feedback 📣 When waiting for a reply from user labels Jul 28, 2020
@aminya
Copy link
Contributor

aminya commented Jul 28, 2020

We should fix xterm then. If you can make an issue there, that would be good.

@UziTech
Copy link
Member

UziTech commented Jul 28, 2020

It hasn't happened to me so I can't debug it. If someone could actually enter the steps to reproduce it I could try to figure out why it is failing.

@the-j0k3r
Copy link
Member

#57 (comment)

@UziTech
Copy link
Member

UziTech commented Jul 28, 2020

The correct solution is probably not calling .fit() when it will throw this error, but I don't know when that is.

@UziTech
Copy link
Member

UziTech commented Jul 28, 2020

@the-j0k3r that comment doesn't help determine why it is failing when .fit() is called

@the-j0k3r
Copy link
Member

the-j0k3r commented Jul 28, 2020

I though this was about the error message, clearly not =)

@UziTech UziTech added the unable to duplicate !! When the issue cannot be duplicated label Jul 28, 2020
@aminya
Copy link
Contributor

aminya commented Jul 30, 2020

Could you add a simple try-catch around the code, and just retry running x-terminal? Whenever I try again, it works without issues.

@rhys-e
Copy link

rhys-e commented Sep 5, 2020

For me, the source of this issue was that the parent container was display: none leading to this error. In my case, I was able to make progress by moving to visibility: hidden for the parent container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unable to duplicate !! When the issue cannot be duplicated xterm-bug 🐛 bug with a related issue in xterm.js
Development

Successfully merging a pull request may close this issue.

5 participants