avh4 / elm-upgrade

Upgrade Elm projects

Home Page:https://www.npmjs.com/package/elm-upgrade

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I get an error using elm-upgrade

HappMacDonald opened this issue · comments

I'm running Win10 64. I have reproduced error via both cmd.com and cygwin bash.

It talks about packages for a bit, my elm-test is out of date yada yada, and then this:

TypeError: Cannot read property 'split' of undefined
at C:\Users\jesse\AppData\Roaming\npm\node_modules\elm-upgrade\upgrade.js:299:11
at Array.forEach ()
at main (C:\Users\jesse\AppData\Roaming\npm\node_modules\elm-upgrade\upgrade.js:276:21)
at C:\Users\jesse\AppData\Roaming\npm\node_modules\elm-upgrade\upgrade.js:386:7
at
at process._tickCallback (internal/process/next_tick.js:188:7)
ERROR: Unable to connect to https://alpha.elm-lang.org. Please try again later.

I don't appear to have any trouble connecting to https://alpha.elm-lang.org via web browser, wget or curl though. So I get the feeling that elm-upgrade has only determined that it cannot connect due to the code exception.

Please advise? I would offer a minimal test case but I might need advise on what to focus on keeping in order to more rapidly shrink first. I'll be glad to dive in once I've got a clearer idea of which way is up in this novel environment.

Thank you much. :)

This might be due to a particular nodejs version? What version of node are you using?

C:\Users\jesse>node -v
v8.11.3

the same error on v9.3.0

INFO: Switching from ohanhi/keyboard-extra (deprecated) to ohanhi/keyboard
WARNING: ohanhi/keyboard has not been upgraded to 0.19 yet!
TypeError: Cannot read property 'split' of undefined
    at /home/sergkam/.nvm/versions/node/v9.3.0/lib/node_modules/elm-upgrade/upgrade.js:297:11
    at Array.forEach (<anonymous>)
    at main (/home/sergkam/.nvm/versions/node/v9.3.0/lib/node_modules/elm-upgrade/upgrade.js:274:21)
    at /home/sergkam/.nvm/versions/node/v9.3.0/lib/node_modules/elm-upgrade/upgrade.js:392:7
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
ERROR: Unable to connect to https://package.elm-lang.org.  Please try again later.

Trying to upgrade my project https://github.com/zalando-incubator/nakadi-ui

This happens for me when the script reaches lukewestby/elm-http-builder. I added some logs around the place where the error happens, and it looks like it was trying to lookup the version info of the package from elm-package.json using the new package name (which wouldn't be in the old elm-package.json)

EDIT: I had to edit the source code to fix this; line 296 uses packageName instead of oldPackageName to do a lookup on the old elm-package.json

Ah, okay, thanks for the info about lukewestby/elm-http-builder -- this must be happening for packages that are getting renamed but haven't been published for 0.19 yet. There should be a quick fix for this.

should be fixed in elm-upgrade@0.19.1 (please reopen if not)