codex-team / codex-team/editor.js

TypeError: Cannot read properties of undefined (reading 'isInternal')

Open
#2,563 3 comments 0 reactions 0 assignees View on GitHub
good first issue issue for docs
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Hello! I'm trying to create a block tune for one of my apps, here is the code:

```
class MyBlockTune {
constructor({ api }) {
this.api = api;
}

isTune() {
return true
}

render() {
return [
{
icon: '',
label: 'Tune label',
onActivate: () => { }
}
]
}
}
```

After activating it with:

```
{
tools: {
myBlockTune: MyBlockTune,
},
tunes: ['myBlockTune'],
}
```

Editor instance crashes with a following exception thrown:

image

Which is this line:

image

After investigating this line a bit with debugger, i can see that `this.tunes.myBlockTune` is not an instance of anything but is `undefined` instead.

Editor.js version: 2.28.2

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.