codex-team / codex-team/editor.js

[Bug] Element with ID is missing (when it actually exists) in NW.js environment

Open
#1,554 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

I'm encountering what seems like a bug trying to use EditorJS in an NW.js environment, whereby it can't seem to "see" the designated editor div on the DOM (it claims "element with ID «editorjs» is missing. Pass correct holder's ID").

Steps to reproduce:
Fire up an NW.js instance using the following example:

./package.json:
```json
{
"name": "Test",
"description": "Test EditorJS",
"main": "html/editor.html",
"window": {
"width": 1024,
"height": 768
},
"dependencies": {
"@editorjs/editorjs": "^2.19.1"
}
}
```

./js/main.js:
```javascript

let EditorJS = require ('@editorjs/editorjs');

document.addEventListener('DOMContentLoaded', (event) => {
const editor = new EditorJS('editorjs');
editor.isReady
.then(() => {
console.log('Editor.js is ready to work!')
})
.catch((reason) => {
console.log(`Editor.js initialization failed because of ${reason}`)
});
})
```

./html/editor.html:
```html




```

Expected behavior:
Editor.JS picks up the designated element and initialises as expected

Actual behavior:
```Editor.js initialization failed because of Error: element with ID «editorjs» is missing. Pass correct holder's ID.```

Environment:
Windows 10 v2004 (19041.804)
NW.js process.versions:
```json
ares: "1.17.1"
brotli: "1.0.9"
chromium: "88.0.4324.150"
icu: "68.1"
llhttp: "2.1.3"
modules: "88"
napi: "7"
nghttp2: "1.42.0"
node: "15.8.0"
node-webkit: "0.51.1"
nw: "0.51.1"
nw-commit-id: "b189fb7-0a4c564-9c3b184-5a47eef"
nw-flavor: "sdk"
openssl: "1.1.1i"
unicode: "13.0"
uv: "1.40.0"
v8: "8.8.278.15"
zlib: "1.2.11"
```

Editor.js version: 2.19.1

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.