waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

[Bug]: Error: Cannot read properties of undefined (reading ‘split’) when opening an empty MD file in the View block

Open ApppleTurnover opened this issue 11 months ago • 0 comments

Current Behavior

When opening an empty Markdown file in the View block, the application throws the following error:

Error: Cannot read properties of undefined (reading 'split')

TypeError: Cannot read properties of undefined (reading 'split')
    at transformBlocks (file:///Applications/Wave.app/Contents/Resources/app.asar/dist/frontend/assets/index-BU5Cfxta.js:31814:26)
    at Markdown (file:///Applications/Wave.app/Contents/Resources/app.asar/dist/frontend/assets/index-BU5Cfxta.js:68342:29)
    at Nh (file:///Applications/Wave.app/Contents/Resources/app.asar/dist/frontend/assets/index-BU5Cfxta.js:14089:10)
    at Vk (file:///Applications/Wave.app/Contents/Resources/app.asar/dist/frontend/assets/index-BU5Cfxta.js:17032:14)
    at Uk (file:///Applications/Wave.app/Contents/Resources/app.asar/dist/frontend/assets/index-BU5Cfxta.js:16726:15)
    at Tk (file:///Applications/Wave.app/Contents/Resources/app.asar/dist/frontend/assets/index-BU5Cfxta.js:16720:27)
    at Ik (file:///Applications/Wave.app/Contents/Resources/app.asar/dist/frontend/assets/index-BU5Cfxta.js:16705:9)
    at Nk (file:///Applications/Wave.app/Contents/Resources/app.asar/dist/frontend/assets/index-BU5Cfxta.js:16436:10)
    at Gk (file:///Applications/Wave.app/Contents/Resources/app.asar/dist/frontend/assets/index-BU5Cfxta.js:16372:62)
    at J2 (file:///Applications/Wave.app/Contents/Resources/app.asar/dist/frontend/assets/index-BU5Cfxta.js:11104:22)
Image

Expected Behavior

Opening an empty Markdown file should not cause an error. The application should either display an empty file without issues or provide a meaningful message indicating that the file is empty.

Steps To Reproduce

  1. wsh view ./
  2. Open empty MD

Wave Version

v0.8.8

Platform

macOS

OS Version/Distribution

No response

Architecture

arm64

Anything else?

No response

Questionnaire

  • [ ] I'm interested in fixing this myself but don't know where to start
  • [ ] I would like to fix and I have a solution
  • [ ] I don't have time to fix this right now, but maybe later

ApppleTurnover avatar Mar 11 '25 09:03 ApppleTurnover