windholtz
I’m trying to get elm and brunch-config.js working with the phoenix 1.3.0-rc directory structure https://github.com/mwindholtz/elm_phoenix_1_3 (UPDATE: URL now points to the solution repo)
The error is that “ReferenceError: Can’t find variable: Elm”
Are there any examples out there on how to set up brunch for 1.3.0-rc ?
brunch-config.js is here:
https://github.com/mwindholtz/elm_phoenix_1_3 /blob/master/assets/brunch-config.js (UPDATED: now points to the solution repo)
I hardcoded executablePath just to at least get it to compile.
And it does compile a seatsaver.js in assets/static/vendor/seatsaver.js
but somehow not loading when I hit the page.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
dustinfarris
I am using 1.3-rc.0. I have this directory structure:
I have elm, elm-css, elm-brunch, and elm-css-brunch installed:
Here’s my brunch config (note I am also using elm-css):
windholtz
Thanks to dustinfarris for the example brunch file.
I updated my example elm/phoenix 1.3 project in GitHub.
see: mwindholtz/hello_elm/blob/master/assets/brunch-config.js
It looks better than before, but still two issues:
(1) Page console now shows … Error: Cannot find module ‘js/app’ from ‘/’
(2) I still needed to hardcode the full path to executablePath
So something is still off base with the pathing.
Suggestions accepted.
ref: https://github.com/mwindholtz/elm_phoenix_1_3
Most
I have my elm folder in the directory
my_app/lib/my_app/web/elm.I’m not using elmCss. The only 2 parts of my brunch config I changed that were relevant to elm are:
and
I should probably move my elm folder to
.
my_app/assets/elmlike @dustinfarris thoughAnd at the top of
my_app/assets/js/app.jsI haveimport Elm from './elm.js';windholtz
Don’t see why but something is calling
/js/elm/elm-stuff/packages/elm-lang/virtual-dom/2.0.4/tests/TestMain.elm
TestMain.elm ?
mm-tfx
I have my elm folder in the
my_app/lib/my_app/web/elmas well.Should we really move it to
my_app/assets/elm?Anyhow I tried both locations and my Elm application disappeared
I mean when I visit wanted web page I can only see blank web page.
What should I check more?
Most
The js console in your web browser might have some clues as to why you have a blank page.
I’d say just keep your elm folder at whatever location works for you for now as things still seem liable to change.
Maybe you missed a configuration step when trying to change the directory?
jackalcooper
Do you have something like “main module” in the brunch config? If so, probably you should update it with your own main module
mm-tfx
Console says Error: There are two Elm modules called
Mainon this page! Rename one of them.It is app.js that is complaining.
What should I check? In app.js I have just two lines for Elm:
const elmDiv = document.getElementById(‘elm-main’)
, elmApp = Elm.Main.embed(elmDiv)
mm-tfx
I have moved elm back to lib/my_app/web/elm
In my brunch-config.js I have
watched: [“static”, “css”, “js”, “vendor”, “../lib/my_app/web/elm”],
elmBrunch: {
elmFolder: “../lib/my_app/web/elm”,
mainModules: [“Main.elm”],
outputFolder: “../vendor”,
makeParameters: [“–warn”]
}
It seems like Elm can be compiled
Elm compile: Main.elm, in ../lib/my_app/web/elm, to ../vendor/main.js
But still page is blank and now console says:
Error: Cannot find module ‘js/app’ from ‘/’
I’ll keep searching but perhaps someone has a suggestion for me. Thanks.
mm-tfx
I have updated Brunch dependencies now and it seems that solved my problem.
I used package.json from new created Phoenix application.