-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ES6: Cannot resolve module 'rxjs/Rx' for rxjs-es #1575
Comments
I had success with changing the import to
|
My webpack build file for reference: |
I am having the same issue using |
Shouldn't babel loader config exclude RxJS module (https://gist.github.com/jadbox/e1d6f409bac4162151f9a12090fdaa44#file-webpack-example-L31) in npm package, by rxjs-es itself is also es15 module? |
I'm having the same problem. |
I've got the same issue. Any workaround known? |
+1 |
Workaround for webpack using |
I'm opening this one up for PRs. I personally don't have time to dig into it, but it sounds like a few people are hitting this issue. Question: If you're using webpack, can you not use use the |
I'll try to look into as well. /cc @david-driscoll for visibility , if I remember correctly it's introduced along with one of typing enhancement. (Sorry @david-driscoll if I'm wrong - early apologize 😉 ) |
So I don't think it's related to any of the typing working, It sounds like webpack doesn't understand that it's an Maybe it's failing to identify the file because there are no imports at the top, it just starts with an export? @jadbox can you try moving those top two exports, down with the rest of the exports in the middle of the file? Does that have any effect? |
@david-driscoll That was my assumption too at #1575 (comment) by webpack config excludes ES15 rx modules. But not 100% sure since other peoples having problem as well. |
I came to think my comment (#1575 (comment)) and @david-driscoll 's comment as well (#1575 (comment)), this is related with bundle / transpiling configuration of ES2015 modules. @jadbox @killtheliterate @noppanit , would you able to confirm if imported ES15 module ( |
@kwonoj looks like babel does not transpile anything out of the box. My transpiled code just refers to ---edit |
That should be |
Yea, I don't believe it's getting bundled. That makes sense, there is likely some |
Thanks for confirmation, @killtheliterate . I'll leave this opened bit more to see other people's experiencing same as well, and close this issue by suggesting update transpiler configuration. Meanwhile @killtheliterate , as @Blesh suggested I'd also suggest to use cjs package which shouldn't have this problem. Is there possibly reason not able to use cjs instead? (or amd, or else) |
@kwonoj definitely, and hey, I'll admit to not reading the README to the point where there are instructions for common 😝 |
I'm closing this issue for now, by believing this is related with transpiling ES2015 module package. Summarize, please check this.
|
FYI, I've opted for the cjs package for now. |
@jadbox sorry, if I missed this, did you confirm that:
I want to make sure of that before we walk away from this. |
Hi Everyone, I have a similiar if not the same issue as @jadbox. I'm not sure if the issue lies with
This seems to be the most informative source of the issue, so I figured posting here makes the most sense even though the issue has been closed. I'm importing rxjs using { test: /\.js$/, exclude: /node_modules/, loader: 'babel'},
{ test: /\.js$/, include: [/module-a/, /module-b/, /rxjs-es/], loader: 'babel' }, As you can see, the node_modules directory is being excluded and three modules, containing es6 code are included. This works for module-a and module-b and not for rxjs-es. The error webpack throws is:
The only workaround I have so far is to use the cjs version of rxjs. |
Having same issue using Atom and the latest node/npm versions on OS X. Thought I'd run a properly configured project like rxjs-app (https://www.npmjs.com/package/rxjs-app) to resolve the issue but I'm still getting the following similar error here as well: ERROR in ./src/main.js ERROR in ./lib/index.js |
Any fix for this using grunt?
|
Because of following issue: ReactiveX/rxjs#1575
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. |
Rxjs: v5 beta 4
npm: 3.7.3
node: 5.9.1
Code to reproduce:
import Rx from 'rxjs/Rx';
to JS fileModule not found: Error: Cannot resolve module 'rxjs/Rx' in /home/jadbox/github/rxjs5proj
Node Modules:
ls -ls node_modules | grep rxjs
4 drwxr-xr-x 11 jadbox jadbox 4096 Apr 1 11:36 rxjs-es
The text was updated successfully, but these errors were encountered: