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

[Bug report]TypeError: null is not an object (evaluating 'document.body.appendChild') #395

Closed
icoco opened this issue Feb 22, 2023 · 4 comments
Labels
🐞bug Something isn't working

Comments

@icoco
Copy link

icoco commented Feb 22, 2023

typescript porject,

`import Cherry from 'cherry-markdown/dist/cherry-markdown.core';
...
const cherryInstance = new Cherry({
id: 'myEditor',
value: markdown,
});

`

while yarn run dev, web browser console throw error : 'null is not an object (evaluating 'document.body.appendChild')'

image

not sure the bug reason

@sunsonliu sunsonliu added the 🐞bug Something isn't working label Feb 22, 2023
@humyfred
Copy link
Collaborator

thanks,we will fix this error soon.

@eviltik
Copy link

eviltik commented Apr 7, 2023

Hi.

Quick & dirty workaround :

window.addEventListener('load', () => {
  document.body.appendChild(this.createDom(SuggesterPanel.panelWrap));
  this.$suggesterPanel = document.querySelector('.cherry-suggester-panel');
});

@eviltik
Copy link

eviltik commented Apr 7, 2023

Btw, current files in dist dir have this bug, which make your lib unusable. Please fix this great project. The ticket has been opened in february.

@humyfred
Copy link
Collaborator

hi,We can‘t reproduce your situation, but we have made some repairs. Please check with the latest version

wty92911 pushed a commit to wty92911/cherry-markdown that referenced this issue May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants