Upgraded to 5.1.0, and now on any port send I'm getting the following error:
ReferenceError: Can't find variable: result
looks like there is no result variable in scope at the line var value = result._0; in the following compiled JS:
function setupIncomingPort(name, callback)
{
var sentBeforeInit = [];
var subs = _elm_lang$core$Native_List.Nil;
var converter = effectManagers[name].converter;
var currentOnEffects = preInitOnEffects;
var currentSend = preInitSend;
// CREATE MANAGER
var init = _elm_lang$core$Native_Scheduler.succeed(null);
function preInitOnEffects(router, subList, state)
{
var postInitResult = postInitOnEffects(router, subList, state);
for(var i = 0; i < sentBeforeInit.length; i++)
{
postInitSend(sentBeforeInit[i]);
}
sentBeforeInit = null; // to release objects held in queue
currentSend = postInitSend;
currentOnEffects = postInitOnEffects;
return postInitResult;
}
function postInitOnEffects(router, subList, state)
{
subs = subList;
return init;
}
function onEffects(router, subList, state)
{
return currentOnEffects(router, subList, state);
}
effectManagers[name].init = init;
effectManagers[name].onEffects = F3(onEffects);
// PUBLIC API
function preInitSend(value)
{
sentBeforeInit.push(value);
}
function postInitSend(incomingValue)
{
var value = result._0;
var temp = subs;
while (temp.ctor !== '[]')
{
callback(temp._0(value));
temp = temp._1;
}
}
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
having the exact same issue.
popped up after upgrading to 5.1.0
Further complicating this issue is that elm-package won't install [email protected] with the following version string in elm-package.json: "elm-lang/core": "5.0.0 <= v < 5.0.1",
Is there a workaround for installing a specific version?
working on a fix, will submit in 1 minute
@rtfeldman, I think this is from your change https://github.com/elm-lang/core/commit/5ec47ca969d3bc995678c8cff73132daf5eeb8b4
Thanks again to @keithasaurus for the report and @lukewestby for the very quick fix! Sorry to everyone who ran into this. A 5.1.1 is out with the fix, but please let me know if there are any further issues.
Most helpful comment
Further complicating this issue is that elm-package won't install [email protected] with the following version string in elm-package.json:
"elm-lang/core": "5.0.0 <= v < 5.0.1",Is there a workaround for installing a specific version?