hermanbanken / RxFiddle

Visualize your Observables
https://rxfiddle.net
MIT License
162 stars 9 forks source link

Troubleshooting browser env. -- getting to work with redux-observables #9

Open tylerweitzman opened 5 years ago

tylerweitzman commented 5 years ago

My file app.reducer.js looks like this:

import * as Rx from 'rxjs';
import RxFiddle from 'rxfiddle';
import { combineReducers, applyMiddleware, compose, createStore } from 'redux';
import logger from 'redux-logger';
import { createEpicMiddleware } from 'redux-observable';
import { authReducer } from './auth/auth.reducer';
import { messengerReducer } from './messenger/messenger.reducer';
import { modalReducer } from './modals/modal.reducer';
import epic from './app.epic';

new RxFiddle({
    Rx,
}).openWindow();

const reducer = combineReducers({
    auth: authReducer,
    messenger: messengerReducer,
    modal: modalReducer,
});

export const store = createStore(
    reducer,
    compose(applyMiddleware(createEpicMiddleware(epic), ...(process.env.ENV === 'DEV' || process.env.FORCE_DEV) ? [logger] : [])),
);

I get the following error when I run the application:

Uncaught TypeError: Cannot read property 'prototype' of undefined
    at new Instrumentation (rxfiddle.js:446)
    at RxFiddle../node_modules/rxfiddle/rxfiddle.js.RxFiddle.instrumentRx5 (rxfiddle.js:1075)
    at RxFiddle../node_modules/rxfiddle/rxfiddle.js.RxFiddle.subscribe (rxfiddle.js:982)
    at RxFiddle../node_modules/rxfiddle/rxfiddle.js.RxFiddle.openWindow (rxfiddle.js:1024)
    at Module../src/app.reducer.js (app.reducer.js:13)
    at __webpack_require__ (bootstrap:63)
    at Module.<anonymous> (bundle-1.7.1r-1.js:181364)
    at Module../src/router/router.js (bundle-1.7.1r-1.js:181534)
    at __webpack_require__ (bootstrap:63)
    at Module.<anonymous> (app.js:1)
    at Module../src/app.js (bundle-1.7.1r-1.js:169098)
    at __webpack_require__ (bootstrap:63)
    at Module../src/index.js (index.js:1)
    at __webpack_require__ (bootstrap:63)
    at Object.0 (bundle-1.7.1r-1.js:181661)
    at __webpack_require__ (bootstrap:63)

Where rxfiddle.js:446 points to Rx.subjects.prototype being undefined