New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.1.0 Ports variable 'result' not defined/in scope? #819

Closed
keithasaurus opened this Issue Jan 23, 2017 · 6 comments

Comments

Projects
None yet
5 participants
@keithasaurus

keithasaurus commented Jan 23, 2017

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;
			}
		}
@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Jan 23, 2017

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.

process-bot commented Jan 23, 2017

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.

@keithasaurus keithasaurus changed the title from 5.1.0 Ports variable name 'result' to 5.1.0 Ports variable 'result' not defined/in scope? Jan 23, 2017

@littleStudent

This comment has been minimized.

Show comment
Hide comment
@littleStudent

littleStudent Jan 23, 2017

having the exact same issue.
popped up after upgrading to 5.1.0

littleStudent commented Jan 23, 2017

having the exact same issue.
popped up after upgrading to 5.1.0

@keithasaurus

This comment has been minimized.

Show comment
Hide comment
@keithasaurus

keithasaurus Jan 23, 2017

Further complicating this issue is that elm-package won't install core@5.0.0 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?

keithasaurus commented Jan 23, 2017

Further complicating this issue is that elm-package won't install core@5.0.0 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?

@lukewestby

This comment has been minimized.

Show comment
Hide comment
@lukewestby

lukewestby Jan 23, 2017

Member

working on a fix, will submit in 1 minute

Member

lukewestby commented Jan 23, 2017

working on a fix, will submit in 1 minute

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jan 23, 2017

Member

@rtfeldman, I think this is from your change elm-lang@5ec47ca

Member

evancz commented Jan 23, 2017

@rtfeldman, I think this is from your change elm-lang@5ec47ca

@lukewestby lukewestby referenced this issue Jan 23, 2017

Merged

Fix #819 #820

@evancz evancz closed this in 7aa56b0 Jan 23, 2017

evancz added a commit that referenced this issue Jan 23, 2017

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jan 23, 2017

Member

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.

Member

evancz commented Jan 23, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment