{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/875","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/875/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/875/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/875/events","html_url":"https://github.com/systemjs/systemjs/issues/875","id":113638534,"number":875,"title":"\"Can't find variable: module\" when running locally on PhoneGap/Cordova","user":{"login":"ggutenberg","id":1128406,"avatar_url":"https://avatars.githubusercontent.com/u/1128406?v=3","gravatar_id":"","url":"https://api.github.com/users/ggutenberg","html_url":"https://github.com/ggutenberg","followers_url":"https://api.github.com/users/ggutenberg/followers","following_url":"https://api.github.com/users/ggutenberg/following{/other_user}","gists_url":"https://api.github.com/users/ggutenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/ggutenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggutenberg/subscriptions","organizations_url":"https://api.github.com/users/ggutenberg/orgs","repos_url":"https://api.github.com/users/ggutenberg/repos","events_url":"https://api.github.com/users/ggutenberg/events{/privacy}","received_events_url":"https://api.github.com/users/ggutenberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-27T17:30:40Z","updated_at":"2015-10-27T21:29:45Z","closed_at":null,"body":"I've included the web files locally in a Cordova project, including everything under `jspm_packages`.  My script tag for system.js looks like:\r\n\r\n`<script src=\"lib/js/toolkit-js/src/jspm_packages/system.js\"></script>`\r\n\r\nand my System.config baseURL looks like:\r\n\r\n`baseURL: cordova.file.applicationDirectory + \"www/\" + \"lib/js/toolkit-js/src/\",`\r\n\r\n`cordova.file.applicationDirectory` resolves to something like:\r\n\r\n`file:///Users/username/Library/Developer/CoreSimulator/Devices/77094B3B-EE20-4DC0-A132-82D7A9985E91/data/Containers/Bundle/Application/0C307D01-9EC8-4458-9C16-54DA1B6B6A31/MyTestApp.app`\r\n\r\nSo the full path becomes:\r\n\r\n`file:///Users/username/Library/Developer/CoreSimulator/Devices/77094B3B-EE20-4DC0-A132-82D7A9985E91/data/Containers/Bundle/Application/0C307D01-9EC8-4458-9C16-54DA1B6B6A31/MyTestApp.app/www/lib/js/toolkit-js/src/`\r\n\r\nI know this path is valid as I can browse to it and see the files there.  However I get the following error/stack trace when using this method:\r\n\r\n```\r\nReferenceError: Can't find variable: module\r\n(anonymous function)main.html:10\r\nappendChild\r\nUsystem.js:13:16884\r\nexecutesystem.js:14:6731\r\nisystem.js:13:31859\r\nnsystem.js:13:30421\r\nexecutesystem.js:14:3452\r\nbsystem.js:13:9955\r\nwsystem.js:13:10328\r\npsystem.js:13:8206\r\nhsystem.js:13:8591\r\n(anonymous function)system.js:13:6897\r\npromiseReactionJob\r\n```\r\n\r\nI've also tried by removing the `file://` prefix and hardcoding the baseURL, but the same error occurs.\r\n\r\nNote that if I *don't* include the files locally and set my script tag to:\r\n\r\n`<script src=\"http://myserver.com/lib/js/toolkit-js/src/jspm_packages/system.js\"></script>`\r\n\r\nand my baseURL to:\r\n\r\n`baseURL: \"/lib/js/toolkit-js/src/\",`\r\n\r\nit doesn't seem to work either.  No errors, but the code that I'm loading just isn't there.  However that code works perfectly in a browser."},"comment":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/comments/151650578","html_url":"https://github.com/systemjs/systemjs/issues/875#issuecomment-151650578","issue_url":"https://api.github.com/repos/systemjs/systemjs/issues/875","id":151650578,"user":{"login":"ggutenberg","id":1128406,"avatar_url":"https://avatars.githubusercontent.com/u/1128406?v=3","gravatar_id":"","url":"https://api.github.com/users/ggutenberg","html_url":"https://github.com/ggutenberg","followers_url":"https://api.github.com/users/ggutenberg/followers","following_url":"https://api.github.com/users/ggutenberg/following{/other_user}","gists_url":"https://api.github.com/users/ggutenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/ggutenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggutenberg/subscriptions","organizations_url":"https://api.github.com/users/ggutenberg/orgs","repos_url":"https://api.github.com/users/ggutenberg/repos","events_url":"https://api.github.com/users/ggutenberg/events{/privacy}","received_events_url":"https://api.github.com/users/ggutenberg/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T21:29:45Z","updated_at":"2015-10-27T21:29:45Z","body":"```\r\nReferenceError: Can't find variable: module\r\n(anonymous function)main.html:10\r\nappendChild\r\n__execsystem.src.js:1383\r\nexecutesystem.src.js:3319\r\nlinkDynamicModulesystem.src.js:2942\r\nlinksystem.src.js:2785\r\nexecutesystem.src.js:3117\r\ndoDynamicExecutesystem.src.js:724\r\nlinksystem.src.js:917\r\ndoLinksystem.src.js:578\r\nupdateLinkSetOnLoadsystem.src.js:626\r\n(anonymous function)system.src.js:439\r\npromiseReactionJob\r\n```"}}