Closed Kikobeats closed 6 years ago
Install the rxjs@5.4.3
solved for me.
npm install rxjs@5.4.3 --save-dev
I had this same issue and had to install rxjs@5.4.3
as a devDependency. My node version is 8.9.1
> redux-history-push-middleware@0.0.1 format /Users/matthewdordal/sites/redux-history-push-middleware
> npx prettier-standard 'src/**/*.js'
Cannot read property 'Observable' of undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! redux-history-push-middleware@0.0.1 format: `npx prettier-standard 'src/**/*.js'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the redux-history-push-middleware@0.0.1 format script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/matthewdordal/.npm/_logs/2017-12-05T04_18_46_383Z-debug.log
This seems to be a regression of rxjs. I verified it resolved following fixes for prettier-standard, but rxjs's fixes might coming soon. See also https://github.com/ReactiveX/rxjs/issues/3155#issuecomment-349027028
diff --git a/package.json b/package.json
index 3cf2fd0..9310ca8 100644
--- a/package.json
+++ b/package.json
@@ -35,7 +35,7 @@
"messageformat": "^1.0.2",
"prettier": "1.7.x",
"prettier-eslint": "^8.1.1",
- "rxjs": "^5.4.0"
+ "rxjs": "^5.5.3"
},
"devDependencies": {
"babel-cli": "^6.24.1",
diff --git a/src/format-files.js b/src/format-files.js
index eefc135..a576ee0 100644
--- a/src/format-files.js
+++ b/src/format-files.js
@@ -2,7 +2,7 @@
import path from 'path'
import fs from 'fs'
import glob from 'glob'
-import Rx from 'rxjs/Rx'
+import * as Rx from 'rxjs/Rx'
import format from 'prettier-eslint'
import chalk from 'chalk'
import getStdin from 'get-stdin'
Weirdly enough, even when doing @fiuzagr's suggestion of npm install rxjs@5.4.3 --save-dev
on yarn
(yarn add -D rxjs@5.4.3
) it doesn't work but when doing it on npm
it does 👍
rxjs@5.5.4
has been released. This issue looks resolved now.
Sorry for the trouble, it's good that rxjs decided to revert backward incompatibility
Using node 8 LTS:
I think code is not relevant; Rx polyfill is not exporting defaults 😢