elm-doc-preview icon indicating copy to clipboard operation
elm-doc-preview copied to clipboard

elm-doc-preview crashes after 30 seconds

Open MartinSStewart opened this issue 3 years ago • 4 comments

If I run elm-doc-preview, it will successfully show me my package documentation but after about 30 seconds, it will crash and the documentation I was viewing will refresh and tell me the page failed to load.

C:\Users\Martin\Desktop\elm-codec-bytes>npx elm-doc-preview
elm-doc-preview 5.0.3 using elm 0.19.1
Previewing MartinSStewart/elm-serialize 1.0.0 from C:\Users\Martin\Desktop\elm-codec-bytes
Browse <http://localhost:8000> to see your documentation
  |> watching package
  |> building C:\Users\Martin\Desktop\elm-codec-bytes documentation
  |> detected src\Serialize.elm modification
  |> building C:\Users\Martin\Desktop\elm-codec-bytes documentation
  |> sending Docs
  |> building C:\Users\Martin\Desktop\elm-codec-bytes documentation
TypeError: Cannot read property 'length' of null

This is occurring on Windows 10 with Firefox. I haven't tested any other OS's or browsers.

MartinSStewart avatar Jul 23 '20 20:07 MartinSStewart

Thank you for reporting. Could you tell me your exact version of Node.js please.

Also, does it also crash when running outside your project (in any other directory, without arguments, it should show the documentation from local cache packages)?

rlefevre avatar Jul 24 '20 10:07 rlefevre

>node --version
v10.16.0

I tested running elm-doc-preview outside of my project and that worked. Then I ran it inside my project again and that also worked. Now it seems to run fine. I'm not sure what changed between yesterday and now...

MartinSStewart avatar Jul 24 '20 17:07 MartinSStewart

It seems to be the same issue as https://github.com/dmy/elm-doc-preview/issues/32, but it was not reproduced either. Please report if you ever manage to reproduce it.

rlefevre avatar Jul 24 '20 18:07 rlefevre

I got it to crash again. Here's the logs from when it occurred outside of a project

C:\Users\Martin\Desktop>npx elm-doc-preview
npx: installed 136 in 17.772s
elm-doc-preview 5.0.3 using elm 0.19.1
No package or application found in C:\Users\Martin\Desktop, running documentation server only
Browse <http://localhost:8000> to see your documentation
TypeError: Cannot read property 'length' of null
C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:313
        throw er
        ^

Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\Martin\AppData\Roaming\npm-cache\_npx\14736\node_modules\elm-doc-preview\static'
    at Object.rmdirSync (fs.js:684:3)
    at rmkidsSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:356:25)
    at rmdirSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:334:7)
    at rimrafSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:304:9)
    at C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:342:5
    at Array.forEach (<anonymous>)
    at rmkidsSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:341:26)
    at rmdirSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:334:7)
    at rimrafSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:304:9)
    at C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:342:5

I'm not sure if it's related but I noticed this happening again after running lamdera live which also uses port 8000. I first started elm-doc-preview while lamdera live was running and while elm-doc-preview seemed to start fine, going to http://localhost:8000 showed me my lamdera app, not the documentation preview. After I turned off lamdera live and started elm-doc-preview again, elm-doc-preview started exhibiting the same symptoms as before with showing the documentation briefly and then crashing.

MartinSStewart avatar Jul 24 '20 20:07 MartinSStewart