Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Localhost development reference error "Mobile is not defined" #58

Closed
deadlyfingers opened this issue Oct 21, 2015 · 0 comments
Closed
Assignees

Comments

@deadlyfingers
Copy link
Contributor

Which 'mockmobile.js' should be copied into thali module dir to avoid reference error?

ReferenceError: Mobile is not defined
    at registerMobilePeerEvent (/Users/david/postcardapp/www/jxcore/node_modules/thali/thaliemitter.js:36:5)
    at /Users/david/postcardapp/www/jxcore/node_modules/thali/thaliemitter.js:41:7

https://github.com/thaliproject/Thali_CordovaPlugin/blob/master/thali/thaliemitter.js#L36

vjrantal added a commit to vjrantal/postcardapp that referenced this issue Oct 22, 2015
The main fix is to assign the mock object to `global.Mobile` rather than
to defining it with `var Mobile`, because otherwise, the definition would apply
only within the current module.

The readme is updated with steps needed after a fresh clone to be able to run
on localhost.

Fixes thaliproject#58.
vjrantal added a commit to vjrantal/postcardapp that referenced this issue Oct 22, 2015
The main fix is to assign the mock object to `global.Mobile` rather than
to defining it with `var Mobile`, because otherwise, the definition would apply
only within the current module.

The trigger for the mockups was moved behind a more explicit MOCK_MOBILE
environment variable rather than NODE_ENV, because the latter is a fairly
commonly used and we don't want these mocks to accidentally apply, for example,
in a Cordova-based environment.

The readme is updated with steps needed after a fresh clone to be able to run
on localhost.

Fixes thaliproject#58.
@vjrantal vjrantal self-assigned this Oct 22, 2015
vjrantal added a commit to vjrantal/postcardapp that referenced this issue Oct 23, 2015
The main fix is to assign the mock object to `global.Mobile` rather than
to defining it with `var Mobile`, because otherwise, the definition would apply
only within the current module.

The trigger for the mockups was moved behind a more explicit MOCK_MOBILE
environment variable rather than NODE_ENV, because the latter is a fairly
commonly used and we don't want these mocks to accidentally apply, for example,
in a Cordova-based environment.

The readme is updated with steps needed after a fresh clone to be able to run
on localhost.

Fixes thaliproject#58.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants