elm-lang / elm-make

A build tool for Elm projects
BSD 3-Clause "New" or "Revised" License
175 stars 45 forks source link

[0.18]Module build failed: Error: ... Could not find package evancz/elm-effects. #139

Closed frenchdonuts closed 7 years ago

frenchdonuts commented 7 years ago

I've just upgraded to Elm 0.18 by:

  1. Using the Mac installer found in the tutorial
  2. Updating elm-format
  3. Using the elm-upgrade tool
  4. Updating elm, elm-hot-loader, and elm-webpack-loader in my package.json
  5. The only package that had no valid migration path was debois/elm-mdl so I switched to MichaelCombs28/elm-mdl instead which had been updated to 0.18.

When I run elm-make I get this error:

Could not find package evancz/elm-effects.

Maybe your elm-stuff/ directory has been corrupted? You can usually fix stuff
like this by deleting elm-stuff/ and rebuilding your project.

I've tried deleting the local elm-stuff/ directory, then elm-package install everything again. I get the same error message. I also tried deleting ~./elm and still no luck. I tried uninstalling and reinstalling Elm platform as well.

I checked every single one of my modules and none of them import Effects. Then I cloned every single dependency and ran elm-make on them in the hopes of catching one that would give me the same error. All of them compiled just fine.

This is weird b/c I don't have evancz/elm-effects as a dependency (elm-package wouldn't let me anyways), nor do any of my packages have evancz/elm-effects as a dependency (I manually checked their elm-package.jsons as well). In fact, I forgot elm-effects even existed its been so long ago I've used it. So what could be going on?

My elm-package.json:

{
    "version": "1.0.0",
    "summary": "Project 3 for Udacity Senior Web Developer Nanodegree",
    "repository": "https://github.com/frenchdonuts/restaurant-reviewer.git",
    "license": "MIT",
    "source-directories": [
        "src/elm"
    ],
    "exposed-modules": [],
    "dependencies": {
        "Bogdanp/elm-time": "1.4.0 <= v < 2.0.0",
        "MichaelCombs28/elm-mdl": "1.0.1 <= v < 2.0.0",
        "elm-lang/core": "5.0.0 <= v < 6.0.0",
        "elm-lang/dom": "1.1.1 <= v < 2.0.0",
        "elm-lang/geolocation": "1.0.2 <= v < 2.0.0",
        "elm-lang/html": "2.0.0 <= v < 3.0.0",
        "elm-lang/http": "1.0.0 <= v < 2.0.0",
        "elm-lang/keyboard": "1.0.1 <= v < 2.0.0",
        "elm-lang/navigation": "2.0.1 <= v < 3.0.0",
        "evancz/elm-markdown": "3.0.1 <= v < 4.0.0",
        "evancz/url-parser": "2.0.1 <= v < 3.0.0",
        "fredcy/elm-parseint": "2.0.0 <= v < 3.0.0",
        "frenchdonuts/elm-autocomplete": "1.0.0 <= v < 2.0.0"
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
}

my Main.elm:

module Main exposing (..)

import Types exposing (..)
import Model exposing (..)
import Msg exposing (..)
import Update
import View
import Nav
import Navigation

-- APP

main : Program Never Model Msg
main =
    Navigation.program Nav.urlParser
        { init = init
        , urlUpdate = urlUpdate
        , view = View.root
        , update = Update.update
        , subscriptions = Update.subscriptions
        }

init : Result String Page -> ( Model, Cmd Msg )
init parseResult =
    let
        ( initModel, initCmd ) =
            Update.init

        ( updateModel, updateCmd ) =
            urlUpdate parseResult initModel
    in
        updateModel ! [ initCmd, updateCmd ]

urlUpdate : Result String Page -> Model -> ( Model, Cmd Msg )
urlUpdate parseResult model =
    case parseResult of
        Ok page ->
            ( { model | currentPage = page }, Cmd.none )

        Err errMsg ->
            ( { model | currentPage = Home }, Cmd.none )

and my package.json:

{
  "name": "restaurant-reviewer",
  "description": "Project 3 for Udacity Senior Web Developer Nanodegree",
  "version": "1.0.0",
  "license": "MIT",
  "author": "frenchdonuts",
  "repository": {
    "type": "git",
    "url": "https://github.com/frenchdonuts/restaurant-reviewer"
  },
  "scripts": {
    "start": "webpack-dev-server --hot --inline --content-base src/",
    "build": "rimraf dist && webpack",
    "watch": "webpack --watch"
  },
  "devDependencies": {
    "autoprefixer": "^6.3.6",
    "bootstrap-sass": "^3.3.6",
    "copy-webpack-plugin": "^3.0.1",
    "css-loader": "^0.23.1",
    "elm": "^0.18.0",
    "elm-hot-loader": "^0.4.0",
    "elm-webpack-loader": "^3.1.0",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.9.0",
    "html-webpack-plugin": "^2.17.0",
    "jquery": "^3.1.0",
    "node-sass": "^3.7.0",
    "postcss-loader": "^0.10.1",
    "rimraf": "^2.5.2",
    "sass-loader": "^4.0.0",
    "style-loader": "^0.13.1",
    "url-loader": "^0.5.7",
    "webpack": "^1.13.1",
    "webpack-dev-server": "^1.14.1",
    "webpack-merge": "^0.14.1"
  }
}
process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

frenchdonuts commented 7 years ago

I found out that this only happens if one of the dependencies of my project is my fork of thebritican/elm-autocomplete, frenchdonuts/elm-autocomplete. Strange, since if I use thebritican/elm-autocomplete, this error doesn't pop up, but if I use my fork with no modifications, this error pops up. On top of this, running elm-make in the root directory of my fork causes no problems. I'll close this issue now since Greg has agreed to help me out with my particular use case of elm-autocomplete.