math2001 / MarkdownLivePreview

A Sublime Text 3 plugin to preview your markdown as you type
https://math2001.github.io/MarkdownLivePreview
MIT License
303 stars 37 forks source link

there is nothing in the preview part #108

Open A-Little-Nut opened 4 years ago

A-Little-Nut commented 4 years ago

Thanks a lot for your works. I met some problems. ![Uploading 捕获.PNG…]()

Traceback (most recent call last):
  File "C:\Users\蒋磊\AppData\Roaming\Sublime Text 3\Installed Packages\MarkdownLivePreview.sublime-package\MarkdownLivePreview.py", line 218, in _update_preview
  File "./python3.3/ntpath.py", line 256, in dirname
  File "./python3.3/ntpath.py", line 220, in split
  File "./python3.3/ntpath.py", line 162, in splitdrive
TypeError: object of type 'NoneType' has no len()

How should I do?

lorddoumer commented 4 years ago

same issue Traceback (most recent call last): File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 525, in on_load_async callback.on_load_async(v) File "C:\xxx\Sublime Text 3\Installed Packages\MarkdownLivePreview.sublime-package\MarkdownLivePreview.py", line 146, in on_load_async self._update_preview(markdown_view) File "C:xxx\Sublime Text 3\Installed Packages\MarkdownLivePreview.sublime-package\MarkdownLivePreview.py", line 204, in _update_preview if time.time() - self.last_update < DELAY / 1000: TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

chirul0 commented 4 years ago

Same problem on Mac OS:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 525, in on_load_async
    callback.on_load_async(v)
  File "/Users/narene/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownLivePreview.sublime-package/MarkdownLivePreview.py", line 146, in on_load_async
    self._update_preview(markdown_view)
  File "/Users/narene/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownLivePreview.sublime-package/MarkdownLivePreview.py", line 204, in _update_preview
    if time.time() - self.last_update < DELAY / 1000:
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
kg4zow commented 4 years ago

Same problem, Sublime 3.2.2(3211) on macOS 10.15.4. I'm not seeing any error messages or stack traces. It does open a new two-pane window, but the pane on the right looks like a normal text editor - in fact it allows me to type and shows line numbers as I enter text there.

mattpopovich commented 4 years ago

Same issue. Sublime 3.2.2(3211) on macOS 10.15.5.

jmbeuken commented 4 years ago

+1

gquittet commented 4 years ago

Same here on macOS 10.15.6

Traceback (most recent call last):
  File "/Users/gquittet/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownLivePreview.sublime-package/MarkdownLivePreview.py", line 218, in _update_preview
  File "./python3.3/posixpath.py", line 151, in dirname
AttributeError: 'NoneType' object has no attribute 'rfind'
Unable to parse command: drag_select {"additive": true, "event": {"button": 1, "x": nan.0, "y": nan.0}}
CalamitousCode commented 4 years ago

I have the exact same error:

Traceback (most recent call last):
  File "C:\Users\MyName\AppData\Roaming\Sublime Text 3\Installed Packages\MarkdownLivePreview.sublime-package\MarkdownLivePreview.py", line 218, in _update_preview
  File "./python3.3/ntpath.py", line 256, in dirname
  File "./python3.3/ntpath.py", line 220, in split
  File "./python3.3/ntpath.py", line 162, in splitdrive
TypeError: object of type 'NoneType' has no len()

ST3 v3.2.2 Build 3211 Windows 10 Pro 2004

After looking at the code and testing with a named file instead of a new untitled file, I believe the issue could be when the code is checking the name/path of a file that doesn't exist:

basepath = os.path.dirname(markdown_view.file_name()) Here's a link to the line in the repo.

hophopkhangaroo commented 3 years ago

Same problem, Sublime 3.2.2(3211) on macOS 10.15.4. I'm not seeing any error messages or stack traces. It does open a new two-pane window, but the pane on the right looks like a normal text editor - in fact it allows me to type and shows line numbers as I enter text there.

I was experiencing the same issue. I found that the live preview doesn't render if you try to include an image in your document. Once I removed all references to images, I was able to see the live preview

dportalesr commented 2 years ago

I solved this by simply restarting sublime text.

arkssheo commented 2 years ago

Seems to happen when trying to preview an unsaved file, just closed off the preview tab and reopened and it's working now. Restarting Sublime should also work, of course.