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

Error when calling term.createDocument(); #181

Closed
MJLHThomassen-Sorama opened this issue Jul 14, 2021 · 8 comments
Closed

Error when calling term.createDocument(); #181

MJLHThomassen-Sorama opened this issue Jul 14, 2021 · 8 comments

Comments

@MJLHThomassen-Sorama
Copy link

When i call term.createDocument(); my program immediately throw the following error:

node_modules\terminal-kit\lib\document\Button.js:155
Button.prototype = Object.create( Text.prototype ) ;
^

TypeError: Object prototype may only be an Object or null: undefined.

Im working on windows, but its also throwing this error in my WSL2 (Ubuntu 20.04) terminal.

@cronvel
Copy link
Owner

cronvel commented Jul 14, 2021

@MJLHThomassen-Sorama What is your Node.js version?

@MJLHThomassen-Sorama
Copy link
Author

v14.15.4

@cronvel
Copy link
Owner

cronvel commented Jul 14, 2021

@MJLHThomassen-Sorama OK, really strange...
Can you paste a minimal code that produce this bug?

@cronvel
Copy link
Owner

cronvel commented Jul 14, 2021

@MJLHThomassen-Sorama I'm currently running on Node.js v14.15.4 too, and everything works fine on my end...

@MJLHThomassen-Sorama
Copy link
Author

MJLHThomassen-Sorama commented Jul 14, 2021

Yes:

const { terminal: term, Palette, Text } = require("terminal-kit");

var document = term.createDocument({
	palette: new Palette()
});

var text = new Text({
	parent: document,
	content: "test",
	x: 10,
	y: 10
});

For some reason, when removing Text from the require line and the var text = new Text() line, it does not generate the error (but obviously, also not the text).

Edit: I was trying to run this sample:
https://github.com/cronvel/terminal-kit/blob/master/sample/document/text-test.js

@MJLHThomassen-Sorama
Copy link
Author

MJLHThomassen-Sorama commented Jul 14, 2021

Addition:

Strangely enough, if i do it like below, i get no problems, though, the example mentioned in my previous post still gives the same error.

const termkit = require("terminal-kit");
const term = termkit.terminal;

var document = term.createDocument({
	palette: new termkit.Palette()
});

var text = new termkit.Text({
	parent: document,
	content: "test",
	x: 10,
	y: 10
});

@cronvel
Copy link
Owner

cronvel commented Jul 14, 2021

@MJLHThomassen-Sorama Thanks for reporting, I will investigate now...

cronvel added a commit that referenced this issue Jul 14, 2021
@cronvel
Copy link
Owner

cronvel commented Jul 14, 2021

@MJLHThomassen-Sorama Fixed on Terminal-Kit v2.1.6.
Thanks for reporting ;)

@cronvel cronvel closed this as completed Jul 14, 2021
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

2 participants