rxjs: ES6: Cannot resolve module 'rxjs/Rx' for rxjs-es
Rxjs: v5 beta 4 npm: 3.7.3 node: 5.9.1
Code to reproduce:
- Create a new Webpack + Babel 5 project using babel-preset-es2015
- npm install rxjs-es --save
- Add
import Rx from 'rxjs/Rx';
to JS file - Webpack buid:
Module 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
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 13
- Comments: 25 (13 by maintainers)
Commits related to this issue
- rxjs-es -> rxjs Because of following issue: https://github.com/ReactiveX/rxjs/issues/1575 — committed to CoderK/github-filter-extension by CoderK 8 years ago
Yea, I don’t believe it’s getting bundled. That makes sense, there is likely some
.babelrc
configuration to say “transpile node_modules too”. After changing my import to the correct one mentioned by @blesh, I seeSyntaxError: Unexpected reserved word
on “import”node_modules/rxjs-es/Observable.js:1
.I’m closing this issue for now, by believing this is related with transpiling ES2015 module package.
Summarize, please check this.
rxjs-es
as well while transpiling.rxjs-es
is native ES2015 module, cannot be consumed without transpilation (at this moment)cjs
package instead.@kwonoj definitely, and hey, I’ll admit to not reading the README to the point where there are instructions for common 😝
That should be
rxjs-es/Observable
if you installedrxjs-es
.My webpack build file for reference: https://gist.github.com/jadbox/e1d6f409bac4162151f9a12090fdaa44