Skip to content
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

Error 404 for rxjs/operators.js on running unit tests #2112

Closed
ahmadqarshi opened this issue Oct 24, 2017 · 4 comments
Closed

Error 404 for rxjs/operators.js on running unit tests #2112

ahmadqarshi opened this issue Oct 24, 2017 · 4 comments

Comments

@ahmadqarshi
Copy link
Contributor

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see use [gitter](https://gitter.im/mgechev/angular2-seed) or [stackoverflow](https://stackoverflow.com/questions/tagged/angular2)

Current behavior

Initially I was getting the error "'build.bundle.rxjs' errored after 562 ms". After the fix made in #2109 that error disappeared but now when I run the unit tests, I get below error:

24 10 2017 13:15:34.764:WARN [web-server]: 404: /base/node_modules/rxjs/operators.js Chrome 61.0.3163 (Windows 10 0.0.0) ERROR: 'Error: Fetch error: 404 Not Found at http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?3c2cb0bc284db65a3e67e988 cdb7175dc5362244:1475:13 at ZoneDelegate.invoke (http://localhost:9876/base/node_modules/zone.js/dist/zone.js?5946249a94 dbe0baef6f1ef0e76e9bb02decfe1a:392:26) at Zone.run (http://localhost:9876/base/node_modules/zone.js/dist/zone.js?5946249a94dbe0baef6f1 ef0e76e9bb02decfe1a:142:43) at http://localhost:9876/base/node_modules/zone.js/dist/zone.js?5946249a94dbe0baef6f1ef0e76e9bb 02decfe1a:873:57 at ZoneDelegate.invokeTask (http://localhost:9876/base/node_modules/zone.js/dist/zone.js?594624 9a94dbe0baef6f1ef0e76e9bb02decfe1a:425:31) at Zone.runTask (http://localhost:9876/base/node_modules/zone.js/dist/zone.js?5946249a94dbe0bae f6f1ef0e76e9bb02decfe1a:192:47) at drainMicroTaskQueue (http://localhost:9876/base/node_modules/zone.js/dist/zone.js?5946249a94 dbe0baef6f1ef0e76e9bb02decfe1a:602:35) at <anonymous>'

Expected behavior

Should not get 404 for RxJs and unit tests should run without any issue.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Windows 10
VS Code

  • Angular Seed Version: d6abbf96184babb00c3f32482edbcd0ddcb6e243
  • Node: node --version = 6.9.5
@ahmadqarshi
Copy link
Contributor Author

I found that with "rxjs": "^5.5.0" in packages.json, it downloads version "5.5.2". I tried "rxjs": "5.4.3" and it started working again.

@mgechev
Copy link
Owner

mgechev commented Oct 26, 2017

@ahmadqarshi fix for ^5.0.0 should be updating the SystemJS configuration.

Would you try to add this line in the mapping section of SYSTEM_CONFIG_DEV and let me know if this makes the unit tests work for you?

If it doesn't, you can remove the line from seed.config.ts in order to prevent future merge conflicts. If it does, you can open a PR with the change, or I can.

@ahmadqarshi
Copy link
Contributor Author

ahmadqarshi commented Oct 26, 2017

@mgechev I tried that already but it didn't work for me. I also tried below pattern entry in karma.conf.js file inside the files array but to no avail

{ pattern: 'node_modules/rxjs/operators/**/*.js', included: false, watched: false }

@mikejohanson
Copy link

While not ideal...the hacky fix that worked for me was to copy the rxjs/operators/index.js to rxjs/operators.js and do a find and replace on './ with './operators/. Fixes the build.prod issue as well. You could do something like: sed -e "s/'\./'.\/operators/" <node_modules/rxjs/operators/index.js >node_modules/rxjs/operators.js. Check out ReactiveX/rxjs#2971 for a disussion on the issue

mgechev added a commit that referenced this issue Nov 16, 2017
mgechev added a commit that referenced this issue Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants