Comments (10)
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.
Closing in favor of #46 which will fix this and others.
from elm-make.
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.
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.
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.
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.
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.
Can you ask on the Elm slack, and then open an issue here once it is clearer what's going on?
from elm-make.
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.
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)
- Unhelpful error if elm-stuff exists but elm-package.json doesn't HOT 3
- modified source files are not reliably detected due to filesystem timestamp resolution HOT 1
- Feature request: --warn-ignore flag for ignoring certain files when using --warn HOT 2
- String literal containing closing script tag makes generated HTML blow up HOT 2
- elm-make get stuck during compile HOT 3
- Stop unnecessary compilation when interface is not changed HOT 7
- Feature Proposoal: Format Flag for JS vs HTML output HOT 2
- Eating all CPU and memory HOT 2
- --warn about unused variables HOT 2
- Elm run-time error: decoder not found HOT 2
- Illegal instruction: 4 HOT 3
- [feature suggestion] elm-make auto insert type annotation HOT 5
- Output of "elm-make" fails to pass the Closure compiler HOT 2
- elm-make crash on unicode escapes in range \xdc00..\xdfff HOT 4
- generates invalid javascript for unicode characters in range \xd800..\xdbff HOT 3
- Recursive anonymous functions in List fold consume all CPU HOT 2
- Elm make generates broken build if repo name contains dots HOT 1
- probably infinite type causing loop HOT 1
- `elm-package.json` should pick up the correct source directory.
- Support for importing generated code through ES6 imports HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-make.