{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1416","repository_url":"https://api.github.com/repos/ReactiveX/RxJS","labels_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1416/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1416/comments","events_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1416/events","html_url":"https://github.com/ReactiveX/RxJS/issues/1416","id":137819243,"number":1416,"title":"Module paths generated after downloading with jspm are corrupted","user":{"login":"xmichaelx","id":1004852,"avatar_url":"https://avatars.githubusercontent.com/u/1004852?v=3","gravatar_id":"","url":"https://api.github.com/users/xmichaelx","html_url":"https://github.com/xmichaelx","followers_url":"https://api.github.com/users/xmichaelx/followers","following_url":"https://api.github.com/users/xmichaelx/following{/other_user}","gists_url":"https://api.github.com/users/xmichaelx/gists{/gist_id}","starred_url":"https://api.github.com/users/xmichaelx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xmichaelx/subscriptions","organizations_url":"https://api.github.com/users/xmichaelx/orgs","repos_url":"https://api.github.com/users/xmichaelx/repos","events_url":"https://api.github.com/users/xmichaelx/events{/privacy}","received_events_url":"https://api.github.com/users/xmichaelx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-02T09:23:03Z","updated_at":"2016-03-02T19:16:19Z","closed_at":null,"body":"# Symptoms\r\n\r\nAs an example from observable/ArrayLikeObservable.ts:\r\n\r\n```js\r\nimport {Scheduler} from '../Scheduler';\r\nimport {Observable} from '../Observable';\r\nimport {ScalarObservable} from './ScalarObservable';\r\nimport {EmptyObservable} from './EmptyObservable';\r\nimport {Subscriber} from '../Subscriber';\r\nimport {Subscription} from '../Subscription';\r\n```\r\n\r\nGenerated JS:\r\n```js\r\n/* */ \r\n\"use strict\";\r\nvar __extends = (this && this.__extends) || function(d, b) {\r\n  for (var p in b)\r\n    if (b.hasOwnProperty(p))\r\n      d[p] = b[p];\r\n  function __() {\r\n    this.constructor = d;\r\n  }\r\n  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n};\r\nvar Observable_1 = require('.js');\r\nvar ScalarObservable_1 = require('./ScalarObservable');\r\nvar EmptyObservable_1 = require('./EmptyObservable');\r\n```\r\n\r\n**var Observable_1 = require('.js');** is what concerns me, because those modules cann't be later properly requested for in browser:\r\n\r\nhttp://localhost:9000/jspm_packages/npm/rxjs@5.0.0-beta.2/observable/.js Failed to load resource: the server responded with a status of 404\r\n\r\n# Versions\r\n\r\nrxjs: npm:rxjs@^5.0.0-beta.2 (from jspm)\r\nTypeScript: 1.8.2 (C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.8)\r\nnpm: 3.6.0\r\njspm: 0.16.30\r\n\r\n# Sample\r\n[TypescriptSystemRxTemplate.zip](https://github.com/ReactiveX/RxJS/files/154391/TypescriptSystemRxTemplate.zip)\r\n\r\nArchive contains small template I made to reproduce the issue:\r\n1. npm install\r\n2. jspm install -y\r\n3. typings install\r\n4. gulp watch\r\n\r\nIt's weird but on some npm environments everything is generated OK and on some not, so far I've tried it on 4 npm environments. 2 OK, 2 have this issue and I wasn't able to get what was the difference between them because they all had the same versions of packages installed."},"comment":{"url":"https://api.github.com/repos/ReactiveX/RxJS/issues/comments/191380646","html_url":"https://github.com/ReactiveX/RxJS/issues/1416#issuecomment-191380646","issue_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1416","id":191380646,"user":{"login":"kwonoj","id":1210596,"avatar_url":"https://avatars.githubusercontent.com/u/1210596?v=3","gravatar_id":"","url":"https://api.github.com/users/kwonoj","html_url":"https://github.com/kwonoj","followers_url":"https://api.github.com/users/kwonoj/followers","following_url":"https://api.github.com/users/kwonoj/following{/other_user}","gists_url":"https://api.github.com/users/kwonoj/gists{/gist_id}","starred_url":"https://api.github.com/users/kwonoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwonoj/subscriptions","organizations_url":"https://api.github.com/users/kwonoj/orgs","repos_url":"https://api.github.com/users/kwonoj/repos","events_url":"https://api.github.com/users/kwonoj/events{/privacy}","received_events_url":"https://api.github.com/users/kwonoj/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T19:16:18Z","updated_at":"2016-03-02T19:16:18Z","body":"(*I'm not expert to JSPM, might be incorrect)\r\n\r\nI've tried couple of examples and came to think this is somewhat related in JSPM or its loader. Original distribution via jspm preserves right path context such as \r\n\r\n`var Observable_1 = require('../Observable');`\r\n(npm package rxjs)\r\n\r\nand while jspm serves it to browser, served files are augmented and losing those context, while original file still stays same and untouched. \r\n\r\nWhat I found was those occur only on import name is same as path, such as\r\n\r\n`var Observable_1 = require('../Observable');` //there's path 'observable' and module 'observable'\r\n`var Subject_1 = require('../Subject');` //there's path 'subject' and module 'subject'\r\n\r\nmaybe some of loader, or jspm was not able to distinguish if module and path have same name and reside in same hierarchy. \r\n\r\nWould you be also able to confirm my finding's same to your cases? If so, I'd like to suggest to ask JSPM (or ts loader) also to get some ideas."}}