atom-community / markdown-preview-plus

Markdown Preview + Community Features
https://atom.io/packages/markdown-preview-plus
Other
370 stars 88 forks source link

Uncaught TypeError: t.getWebContents is not a function #520

Closed UziTech closed 3 years ago

UziTech commented 3 years ago

webview.getWebContents was removed in electron v9

https://github.com/atom-community/markdown-preview-plus/blob/fce5ad57823422c35c147773e308b0c5658db775/src/markdown-preview-view/webview-handler.ts#L17

Steps to reproduce:

  1. Upgrade to Atom v1.56.0-beta0
  2. Open markdown preview

Atom: 1.56.0-beta0 x64 Electron: 9.4.4 OS: Microsoft Windows 10 Pro Thrown From: markdown-preview-plus package 4.9.0

Stack Trace

Uncaught TypeError: t.getWebContents is not a function

At C:\Users\tjbrix\.atom\packages\markdown-preview-plus\dist\main.js:1

TypeError: t.getWebContents is not a function
    at HTMLElement.n (/packages/markdown-preview-plus/dist/main.js:1:91921)
    at WebViewImpl.dispatchEvent (electron/js2c/renderer_init.js:155:2221)
    at dispatchEvent (electron/js2c/renderer_init.js:143:1883)
    at electron/js2c/renderer_init.js:143:3008
    at EventEmitter.<anonymous> (electron/js2c/renderer_init.js:127:872)
    at EventEmitter.emit (events.js:223:5)
    at Object.onMessage (electron/js2c/renderer_init.js:115:818)

Commands

     -3:46.6.0 editor:duplicate-lines (input.hidden-input)
  5x -3:41.2.0 core:backspace (input.hidden-input)
  4x -3:37.8.0 core:move-right (input.hidden-input)
  7x -3:35.8.0 core:delete (input.hidden-input)
     -3:23.6.0 core:move-right (input.hidden-input)
     -3:22.7.0 core:backspace (input.hidden-input)
 11x -3:22.4.0 core:move-right (input.hidden-input)
  2x -3:08.9.0 core:move-left (input.hidden-input)
  3x -2:58.8.0 core:backspace (input.hidden-input)
     -2:57.3.0 core:move-right (input.hidden-input)
     -2:56.6.0 core:backspace (input.hidden-input)
 14x -2:56.3.0 core:move-right (input.hidden-input)
     -2:50.4.0 core:move-left (input.hidden-input)
     -2:45.6.0 intentions:highlight (input.hidden-input)
     -2:45.5.0 core:save (input.hidden-input)
  3x -2:32.8.0 markdown-preview-plus:toggle (input.hidden-input)

Non-Core Packages

atom-beautify 1.0.0 
atom-debug-ui 1.0.4 
atom-ide-datatip 0.24.0 
atom-ide-debugger-node 0.7.3 
atom-ide-definitions 0.4.1 
atom-ide-hyperclick 1.0.9 
atom-ide-markdown-service 2.0.0 
atom-ide-outline 2.0.0 
atom-ide-signature-help 0.15.3 
atom-ide-ui 0.13.0 
atom-live-server 2.3.0 
atom-minify 0.8.0 
atom-music 2.0.3 
atom-npm-outdated 0.19.0 
atom-overtype-mode 0.4.0 
atom-path-intellisense 1.2.2 
atom-ternjs 0.20.0 
auto-detect-indentation 1.3.0 
autoclose-html-plus 0.27.2 
autocomplete-emojis 2.5.0 
autocomplete-html-entities 0.2.0 
autocomplete-json 5.5.5 
autocomplete-paths 2.13.0 
bracket-colorizer 1.4.0 
busy-signal 2.0.1 
change-case 0.6.5 
color-picker 2.3.0 
context-menu-remove 0.2.1 
cson 2.0.1 
cursor-history 0.14.0 
dbclick-tree-view 1.6.3 
dbl-click-select-inside-brackets 1.0.0 
dec-hex-oct-bin 0.1.4 
docblockr 0.13.7 
double-tag 1.7.0 
editor-stats 0.17.0 
emmet 2.4.3 
eslint-format 1.0.23 
external-open 0.6.3 
file-icons 2.1.46 
file-watcher 2.0.0 
flex-tool-bar 2.2.5 
git-menu 3.2.8 
git-time-machine 2.1.0 
highlight-selected 0.17.0 
hyperlink-hyperclick 3.0.2 
ide-typescript 0.9.1 
indent-guide-improved 1.4.13 
intentions 1.1.5 
language-babel 2.85.0 
language-batch 0.4.0 
language-diff 0.7.0 
language-htaccess 0.2.0 
language-ini 1.23.0 
language-json5 1.1.1 
language-latex 1.2.0 
language-peg-pegjs 0.1.0 
language-powershell 5.0.0 
language-regexp 1.1.3 
line-diff-details-plus 1.9.1 
line-ending-converter 1.3.2 
linter 3.3.0 
linter-coffeelint 2.0.71 
linter-coverage 0.3.0 
linter-eslint 8.5.5 
linter-htmlhint 1.6.3 
linter-js-standard 7.0.0 
linter-js-yaml 1.4.6 
linter-jsonlint 1.4.0 
linter-markdown 5.2.11 
linter-phpcs 1.7.6 
linter-sass-lint 1.9.0 
linter-stylelint 4.5.1 
linter-ui-default 3.3.0 
markdown-preview-plus 4.9.0 
markdown-to-pdf 0.1.1 
minimap 4.39.8 
minimap-bookmarks 0.4.6 
minimap-cursorline 1.0.2 
minimap-find-and-replace 5.0.8 
minimap-git-diff 4.3.6 
minimap-highlight-selected 4.6.5 
minimap-lens 0.8.2 
minimap-linter 2.2.2 
minimap-pigments 0.2.2 
minimap-selection 4.5.4 
minimap-split-diff 0.3.7 
notifications-plus 2.0.18 
notifications-plus-confetti 0.2.0 
open 2.0.5 
open-terminal-here 2.3.2 
php-ide-serenata 5.4.0 
pigments 0.40.6 
project-config 1.0.2 
project-manager 3.3.8 
remote-ftp 2.2.4 
sass-autocompile 0.13.5 
scroll-editor-on-middle-click 0.7.0 
split-diff 1.6.1 
Sublime-Style-Column-Selection 1.7.5 
sync-settings 5.2.7 
sync-settings-git-location 1.1.11 
tabs-to-spaces 1.0.5 
teletype 0.13.4 
temp-find-and-replace 0.219.3 
terminal-commands 1.4.0 
termination 0.7.6 
terminus 4.1.2 
text-manipulation 0.6.0 
themed-context-menu 0.2.3 
todo-show 2.3.2 
tool-bar 1.4.2 
trailing-semicolon 1.1.0 
trailing-spaces 0.4.0 
uzitech-toggle-quotes 0.0.0 
vic 0.0.0 
wakatime 9.0.2 
web-accessibility-checker 0.1.4 
x-terminal 13.0.2 
lierdakil commented 3 years ago

Thanks for the heads-up! Apparently, that's an easy fix. I've released v4.9.1 which (hopefully) works, but I don't have atom v1.56 so can't verify right away. If you could check if everything's in order that would be great.

bewam commented 3 years ago

Same Here.

Atom: 1.51.0 x64 Electron: 5.0.13 OS: Ubuntu 20.04.2 Thrown From: markdown-preview-plus package 4.9.1

lierdakil commented 3 years ago

@bewam please update Atom to the current version (which is 1.55.0) (edit: I probably should've bumped the minimal version, but that ship has sailed regrettably)

bewam commented 3 years ago

It works like a charm with 1.55.

UziTech commented 3 years ago

it works in v1.56.0-beta0 :+1:

carybakker commented 3 years ago

I'm seeing this with the current release (non-beta) 1.56.0...

image
lierdakil commented 3 years ago

@carybakker check if this reproduces in markdown-preview-plus v4.9.4 and post the full report if it does. You can get the full report by clicking on the little clipboard icon near the bottom image -- it will be copied to the clipboard. For the purpose of bookkeeping, please file it as a new issue. Thanks.

hailin-lu commented 3 years ago

Got this new issue [Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.56.0 x64 Electron: 9.4.4 OS: macOS 11.2.3 Thrown From: markdown-preview-plus package 4.9.0

Stack Trace

Uncaught TypeError: t.getWebContents is not a function

At /Users/hailinlu/.atom/packages/markdown-preview-plus/dist/main.js:1

TypeError: t.getWebContents is not a function
    at HTMLElement.n (/packages/markdown-preview-plus/dist/main.js:1:91921)
    at WebViewImpl.dispatchEvent (electron/js2c/renderer_init.js:155:2221)
    at dispatchEvent (electron/js2c/renderer_init.js:143:1883)
    at electron/js2c/renderer_init.js:143:3008
    at EventEmitter.<anonymous> (electron/js2c/renderer_init.js:127:872)
    at EventEmitter.emit (events.js:223:5)
    at Object.onMessage (electron/js2c/renderer_init.js:115:818)

Commands

     -0:53.6.0 command-palette:toggle (input.hidden-input)
     -0:50.7.0 core:confirm (input.hidden-input)
     -0:50.7.0 markdown-preview-plus:toggle (input.hidden-input)

Non-Core Packages

atom-html-preview 0.2.6 
atom-live-server 2.3.0 
atom-path-intellisense 1.2.2 
atomic-management 0.3.1 
color-picker 2.3.0 
cornell-info1300 0.5.1 
document-outline 2.1.2 
inline-markdown-images 1.15.0 
language-markdown 0.37.0 
linter 3.3.0 
linter-ui-default 3.2.5 
markdown-preview-plus 4.9.0 
pigments 0.40.6 
prettier-atom 0.60.1 
tree-view-git-status 1.5.3 
w3c-validation 0.4.0 
lierdakil commented 3 years ago

Thrown From: markdown-preview-plus package 4.9.0

@hailin-lu please update to the latest version.