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

Path-mapping issue #2988

Closed
aksyonov opened this issue Oct 23, 2017 · 4 comments
Closed

Path-mapping issue #2988

aksyonov opened this issue Oct 23, 2017 · 4 comments

Comments

@aksyonov
Copy link

RxJS version:
5.5.0
Angular-cli: 1.4.9

Code to reproduce:
import {startWith} from 'rxjs/operators/startWith'

Expected behavior:
Should import without errors

Actual behavior:
node_modules/rxjs/_esm5/operators/index.js/startWith.js doesn't exist
Note index.js in path

Additional information:
The issue is probably related to rxjs/_esm5/path-mapping.js file:

...
    "rxjs/operators/groupBy": path.resolve(PATH_REPLACEMENT, "rxjs/_esm5/operators/groupBy.js"),
    "rxjs/operators/ignoreElements": path.resolve(PATH_REPLACEMENT, "rxjs/_esm5/operators/ignoreElements.js"),
    "rxjs/operators/index": path.resolve(PATH_REPLACEMENT, "rxjs/_esm5/operators/index.js"),
    "rxjs/operators": path.resolve(PATH_REPLACEMENT, "rxjs/_esm5/operators/index.js"),
    "rxjs/operators/isEmpty": path.resolve(PATH_REPLACEMENT, "rxjs/_esm5/operators/isEmpty.js"),
    "rxjs/operators/last": path.resolve(PATH_REPLACEMENT, "rxjs/_esm5/operators/last.js"),
    "rxjs/operators/map": path.resolve(PATH_REPLACEMENT, "rxjs/_esm5/operators/map.js"),
    "rxjs/operators/mapTo": path.resolve(PATH_REPLACEMENT, "rxjs/_esm5/operators/mapTo.js"),
    "rxjs/operators/materialize": path.resolve(PATH_REPLACEMENT, "rxjs/_esm5/operators/materialize.js"),
...

As you see, "rxjs/operators" is between other modules. Importing modules that are before this line works as expected, but all modules after it fail with error. I think need to move line

"rxjs/operators": path.resolve(PATH_REPLACEMENT, "rxjs/_esm5/operators/index.js"),

after other "rxjs/operators/..." modules.

@kwonoj
Copy link
Member

kwonoj commented Oct 23, 2017

/cc @jasonaden

@jasonaden
Copy link
Collaborator

jasonaden commented Oct 23, 2017

@aksyonov Thanks. I also found this issue. It's due to a problem with how Webpack handles aliasing. Here's the PR that fixes it for rxjs: #2987. I also filed an issue against Webpack as depending on sequence of keys in an object is not good.

/cc @kwonoj

@slawojstanislawski
Copy link

The fix landed in 5.5.2 (24854cf#diff-4ac32a78649ca5bdd8e0ba38b7006a1eR7). Could this be closed then?

@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
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

4 participants