GithubHelp home page GithubHelp logo

Comments (10)

evancz avatar evancz commented on May 18, 2024

Can you add what error is given in the original description?

Also, this is because errors are structured in elm-compiler but not in elm-make. To figure out all the imports and crawl the dependencies, we have to read these things. If there's an error, it is found in elm-make which does not have facilities for this.

from elm-make.

evancz avatar evancz commented on May 18, 2024

Closing in favor of #46 which will fix this and others.

from elm-make.

lookyhooky avatar lookyhooky commented on May 18, 2024

Using elm 0.17.1, I am not recieving errors reported as json when using the --report=json flag. With the same file contents as @ajhager posted in the original issue and running the command elm-make --warn --report=json Main.elm I get the following

 -- SYNTAX PROBLEM ----------------------------------------------------- Main.elm

I ran into something unexpected when parsing your code!

1| module Main where
               ^
I am looking for one of the following things:

    something like `exposing (..)` which replaced `where` in 0.17
    whitespace

from elm-make.

evancz avatar evancz commented on May 18, 2024

You are having issues upgrading from 0.16 to 0.17. Read https://github.com/elm-lang/elm-platform/blob/master/upgrade-docs/0.17.md and know that you may need to delete elm-stuff/

from elm-make.

lookyhooky avatar lookyhooky commented on May 18, 2024

Am I using the wrong command line flag? I have never installed or used 0.16, so I am unsure if its an upgrade issue. I am using the flag as shown in the elm-make --help for 0.17.

elm make --help
elm-make 0.17.1 (Elm Platform 0.17.1)

Usage: elm-make [FILES...] [--output FILE] [--yes] [--report FORMAT] [--warn]
                [--docs FILE] [--prepublish] [--prepublish-core]
  build Elm projects

Available options:
  -h,--help                Show this help text
  --output FILE            Write result to the given .html or .js FILE.
  --yes                    Reply 'yes' to all automated prompts.
  --report FORMAT          Format of error and warning reports (e.g.
                           --report=json)
  --warn                   Report warnings to improve code quality.
  --docs FILE              Write documentation to FILE as JSON.

Examples:
  elm-make Main.elm                     # compile to HTML in index.html
  elm-make Main.elm --output main.html  # compile to HTML in main.html
  elm-make Main.elm --output elm.js     # compile to JS in elm.js
  elm-make Main.elm --warn              # compile and report warnings

Full guide to using elm-make at <https://github.com/elm-lang/elm-make>

from elm-make.

evancz avatar evancz commented on May 18, 2024

Look at the error you are getting. It is a syntax error from writing module Main where instead of module Main exposing (..) This issue was opened with 0.16 syntax, so that's the kind of error you are getting.

from elm-make.

lookyhooky avatar lookyhooky commented on May 18, 2024

Okay updating the file to error on Fexposing rather than where

-- Main.elm
module Main exposing (..)

import Html Fexposing (..)

main : Html
main = text "Test"

I still do not get a json error when executing elm-make --report=json Main.elm

-- SYNTAX PROBLEM ----------------------------------------------------- Main.elm

I need a fresh line to start a new declaration. This means a new line that
starts with stuff, not with spaces or comments.

3| import Html Fexposing (..)
               ^
I am looking for one of the following things:

    reserved word `as`
    reserved word `exposing`
    whitespace

Shouldn't a json message be returned?

I am trying to use Emacs to edit my elm files and Flycheck for on the fly syntax checking. Though flycheck-elm relies on the --report=json feature of elm-make to parse error messages, and since it is not receiving json it cannot parse the message.

from elm-make.

evancz avatar evancz commented on May 18, 2024

Can you ask on the Elm slack, and then open an issue here once it is clearer what's going on?

from elm-make.

lookyhooky avatar lookyhooky commented on May 18, 2024

I will check on Elm slack and Stack Overflow. Though it seems clear elm-make returns regular error messages in some situations even though the --report=json flag was used. The 0.16 syntax error in my first comment, misspelling exposing as Fexposing, and using an unknown module as in below do not return json error messages even though the proper flag was used.

-- Main.elm
module Main exposing (..)

import Unknown -- Some uninstalled module
import Html exposing (..)

main : Html
main = text "Test"

Executing elm-make --report=json Main.elm returns the message below rather than json.

I cannot find module 'Unknown'.

Module 'Main' is trying to import it.

Potential problems could be:
  * Misspelled the module name
  * Need to add a source directory or new dependency to elm-package.json

from elm-make.

lookyhooky avatar lookyhooky commented on May 18, 2024

I am will admit ignorance with Haskell, though it appears the function printError in the BuildManager module sends regular errors directly to stderr rather than respect the --report=json flag.

from elm-make.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.