Elm.embed is not a function

942 views
Skip to first unread message

liumengjiang

unread,
Jun 9, 2016, 10:09:37 AM6/9/16
to Elm Discuss
I followed the blog of Phoenix with Elm - Part2, there is no any error except nothing displayed in the page. and in the chrome console, there is a error of "Uncaught TypeError: Elm.embed is not a function." but in the console, Elm.SeatSaver.embed(document.getElementById('elm-main'), {}) is OK.an in the and in web/static/js/app.js, alert(Elm.SeatSaver) show 'undefined'. Any one can explain the issue?

Gage Peterson

unread,
Jun 9, 2016, 12:00:27 PM6/9/16
to Elm Discuss

liumengjiang

unread,
Jun 9, 2016, 9:33:07 PM6/9/16
to Elm Discuss
Ihave already found the change, but in a phoenixframework project, if I changed the Elm.embed to Elm.SeatSaver.embed(elmDiv, {}) in app.js, the error in console will be "Uncaught TypeError: Elm.SeatSaver is not a function", but I can invoke the Elm.SeatSaver.embed(elmDIv, {}).

在 2016年6月10日星期五 UTC+8上午12:00:27,Gage Peterson写道:

Gage Peterson

unread,
Jun 9, 2016, 11:14:10 PM6/9/16
to Elm Discuss
Hmm... that's odd. This may sound silly but you don't have `Elm.SeatSaver(elmDiv, {})` (no embed on the end) anywhere do you? Also make sure you recompile it (I assume you're using brunch or something like that)

--
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/yLCi8oJmBOQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

liumengjiang

unread,
Jun 10, 2016, 12:50:04 AM6/10/16
to Elm Discuss
Sorry for my low level mistake.

With the change to 'Elm.SeatSaver.embed(document.getElementById('elm-main'), {})', will cause the 'Uncaught TypeError: Cannot read property 'embed' of undefined'.

在 2016年6月10日星期五 UTC+8上午11:14:10,Gage Peterson写道:

Alan Gardner

unread,
Jun 10, 2016, 10:02:39 AM6/10/16
to Elm Discuss
Hi,

I replied directly but should have replied here. I need to update those posts for Elm 0.17. I've gone through posts 1-6 so far but need an internal review before posting. Hope to have that done by next week.

Thanks for your patience :)

liumengjiang

unread,
Jun 10, 2016, 10:47:19 AM6/10/16
to Elm Discuss
Very thanks and waiting for you, I study elm and phoenix just fellow your great articles!

在 2016年6月10日星期五 UTC+8下午10:02:39,Alan Gardner写道:

Alan Gardner

unread,
Jun 11, 2016, 12:30:07 PM6/11/16
to Elm Discuss
You're most welcome :)

Charles Munat

unread,
Jun 14, 2016, 6:32:38 AM6/14/16
to Elm Discuss
I'm also waiting for this. Appreciate your efforts much!
Reply all
Reply to author
Forward
0 new messages