Open powder opened 5 years ago
Yeah, the simple-example repo is almost certainly out of date. I'll see about updating it.
That said, if you're following the instructions at http://sugar-framework.github.io/getting-started/, then that suggests Sugar itself is running into some kind of trouble there. I'll look into that as well.
Just noting that I ran into this as well.
Sorry for the delayed response here.
So I was able to get through the Getting Started instructions on the latest versions of Erlang and Elixir, with the caveat that I had to blow away the pregenerated EEx template (else mix server
would fail with symptoms identical to #79 ). I wasn't able to reproduce this JSON-related error specifically, weirdly enough, but it's clear that Sugar can use some TLC across the board.
There's been talk previously of just scrapping Sugar's template compiler, given that it's buggy and overdue for eventual replacement, and Sugar's strength is more in the router/controller layer(s) anyway. Better to enforce a separation of concerns here and - like we did already by trimming out the Ecto dependency - just delegate view handling to some other system separate from Sugar to give users the freedom to use whatever best fits their applications (my dream goal here has been to create separate applications called Spice and EverythingNice for the model and view layers, respectively, but let's focus on Sugar first :) ).
My 2018 New Year's Resolution was to get OTPCL to the point where it could actually evaluate scripts. My 2019 New Year's Resolution is to resume polishing up Sugar to be the proper contender to Phoenix that the Elixir ecosystem needs. Hopefully I'll be able to keep up this resolution streak.
Hey just mentioning that trying to use elixir 1.16 with OTP 26 gives me the following compilation error:
~/dev/pessoal/play_with_me is v0.1.0 via took 5s
❯ mix sugar.init
error: undefined variable "deps"
│
8 │ deps: deps,
│ ^^^^
│
└─ /Users/matheus.ashton/dev/pessoal/play_with_me/deps/http_router/mix.exs:8:13: HttpRouter.Mixfile.project/0
error: undefined variable "package"
│
10 │ package: package,
│ ^^^^^^^
│
└─ /Users/matheus.ashton/dev/pessoal/play_with_me/deps/http_router/mix.exs:10:16: HttpRouter.Mixfile.project/0
error: undefined variable "description"
│
11 │ description: description,
│ ^^^^^^^^^^^
│
└─ /Users/matheus.ashton/dev/pessoal/play_with_me/deps/http_router/mix.exs:11:20: HttpRouter.Mixfile.project/0
warning: function deps/0 is unused
│
21 │ defp deps do
│ ~
│
└─ /Users/matheus.ashton/dev/pessoal/play_with_me/deps/http_router/mix.exs:21:8: HttpRouter.Mixfile (module)
warning: function description/0 is unused
│
32 │ defp description do
│ ~
│
└─ /Users/matheus.ashton/dev/pessoal/play_with_me/deps/http_router/mix.exs:32:8: HttpRouter.Mixfile (module)
warning: function package/0 is unused
│
40 │ defp package do
│ ~
│
└─ /Users/matheus.ashton/dev/pessoal/play_with_me/deps/http_router/mix.exs:40:8: HttpRouter.Mixfile (module)
Error while loading project :http_router at /Users/matheus.ashton/dev/pessoal/play_with_me/deps/http_router
** (CompileError) deps/http_router/mix.exs: cannot compile module HttpRouter.Mixfile (errors have been logged)
@ashton Try adding {:http_router, git: "https://github.com/sugar-framework/elixir-http-router", branch: "master"}
to the deps
in your project's mix.exs
. If that works, then I just need to cut a new release :)
Likely this indicates that the simple repo hasn't been touched in a long while. Haven't dived into it further than following the instructions as listed and seeing it fail.
The following is my elixir/erlang version string if that's useful in understanding where this error is coming from.