Troubleshooting the error message: "Uncaught TypeError: this.schedulerActionCtor is not a constructor" that occurs while executing the rootEpic in redux-

As I delve into learning how redux-observables work with typescript, I've been following a project example and referencing various guides like those found here and here. However, no matter what I try in setting up the epics/middleware, I keep encountering the same error message:

Uncaught TypeError: this.schedulerActionCtor is not a constructor
    at QueueScheduler.Scheduler.schedule (Scheduler.js?ef44:10)
    at eval (observeOn.js?142b:6)
    ...

Below is the code snippet I'm attempting to troubleshoot while setting up the middleware.

example/epics.ts:

import { delay, filter, mapTo } from 'rxjs/operators'
import { isOfType } from "typesafe-actions"

import { ExampleActionTypes } from './types'
import * as exampleActions from './actions'


export const pingEpic: Epic<RootAction, RootAction, RootState> = (action$) => action$.pipe(
  filter(isOfType(ExampleActionTypes.PING)),
  delay(1000), // Asynchronously wait 1000ms then continue
  mapTo(exampleActions.pong())
)

export const buttonEpic: Epic<RootAction, RootAction, RootState> = (action$) => action$.pipe(...)

export default {
  pingEpic, 
  buttonEpic
}

In rootEpic.ts:

import { combineEpics } from 'redux-observable';
import {
  pingEpic,
  buttonEpic
} from './example/epics';


export default combineEpics(
  pingEpic,
  buttonEpic
)

And in store.ts:

...
export const epicMiddleware = createEpicMiddleware<RootAction, RootAction, RootState>()

const middlewares = [epicMiddleware]
const enhancer = composeEnhancers(applyMiddleware(...middlewares))

const store = createStore(
  rootReducer,
  initialState,
  enhancer
)

epicMiddleware.run(rootEpic)
...

The package versions from package.json are:

    "redux": "4.1.0",
    "redux-observable": "1.2.0",
    "typesafe-actions": "5.1.0"

If I comment out the epicMiddleware.run(rootEpic) line, the error disappears. It seems there's a mismatch in types or perhaps a step I'm overlooking. Can anyone spot where things might be going awry?

Answer №1

Problem resolved by updating to newer versions at

<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9eecfbfaebe6b3f1fcedfbece8fffcf2fbdeacb0aeb0aeb3ecfdb0ac">[email protected]</a>
. Details can be found in this post on the redux-observables repository.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Struggling to master YAML integration with Google App Engine?

Seeking assistance with YAML as I am new to it: application: baking-tutorial version: secureable runtime: python27 api_version: 1 threadsafe: true handlers: - url: /robots\.txt static_files: static/robots.txt upload: static/robots\.txt - url: ...

The act of transferring non-textual information into web-based applications

Is it possible for a user to copy and paste a selection of pixels from MSPaint into a browser-based app using JavaScript in current browsers? If not, will HTML5 make this possible in the future? Alternatively, could something like Flex or Silverlight be us ...

Only one argument is accepted by the constructor of NGRX data EntityServicesBase

In an attempt to enhance the convenience of my application class, I decided to create a Sub-class EntityServices based on the NGRX/data documentation which can be found here. Despite following the provided example, it appears that it does not function pro ...

The jQuery UI Sortable functions are being triggered at lightning speed

I am currently working on a project where users can create a seating chart, add rows and tables, and move the tables between different rows. The functionality for adding rows and moving tables already exists in the code. However, I am facing an issue where ...

Issue with process.env.NODE_ENV not functioning appropriately in NodeJS when utilizing package.json scripts

I currently have three separate databases configured for testing, development, and production purposes. My goal now is to make my express app switch between these databases based on the script that is being executed. These are the scripts I am using: "s ...

The use of ExpressJs res.sendFile is not effective following the implementation of middleware

Currently, my focus is on mastering JWT and its implementation in Node.js with Express. I've developed a middleware that aims to authenticate users using a token: app.use(function(req, res, next) { if(req.headers.cookie) { var authentication = req.h ...

Adding styles dynamically using methods is not supported in Vue.js

When it comes to adding styles to an HTML element from methods, I ran into a small hiccup. Here's what I tried: <div class="add-profile-img" v-bind:style="getBackgroundImg()"> The method in question is: getBackgroundImg: function() { return { ...

Tips for retrieving data from a nested Axios request?

Currently, I am working on a series of steps: Phase 1: Initiate an Axios call to verify if the record exists in the database. Phase 2: In case the record does not exist, trigger a POST API call to establish the data and retrieve the POST response. Pha ...

Utilizing Javascript to implement a tooltip feature for dynamically inserted text

I recently incorporated a brief jQuery tooltip plugin into my site. It consists of approximately ten lines of code and works smoothly, as demonstrated in this demo. However, I encountered an issue when attempting to add new text that should also trigger t ...

Transfer an object for reusability in a different JavaScript file without utilizing the default operator

I have a scenario where I have two files organized in a tree structure that defines an object. The first file is called common.js. export default { table: { actions: { save: 'Save', delete: 'Delete', update: ...

Transforming Unicode escape sequences into symbols and displaying them in a DOM element

Using the latest versions of Firefox and Chrome with jQuery 1.x edge. When an ajax request returns a single line of minified JSON text like this: { "fromSymbol": "\\u04b0", "toCurrency": "AUD", "toSymbol": "\\u0024", "convFact ...

Resolve cyclic dependency caused by utilizing the useFactory parameter

I am working with an injectable service that utilizes the useFactory attribute to determine whether it should be injected or if an implemented type should be used instead. import { Injectable } from '@angular/core'; import { Router } from ' ...

Steps for invoking a Polymer dialog within a JavaScript function

Dealing with Javascript scopes has always been a struggle for me. My goal is to display a loading dialog while waiting for a JSON response, as shown below: toQueueRequest.onreadystatechange = function () { if (toQueueRequest.readyStat ...

Images flicker as they transition

Within my HTML body, I have the following: <a id="Hal9000"> In addition, there is a function included: function Hal(MSG){ document.getElementById("Hal9000").innerHTML = "<img src=\"+preloadImage("HAL9000.php?Text="+MSG)+"\"\>" ...

Learn how to implement console-like Tail functionality in a web application using the MaterialUI TextField component as the console interface

Issue with Component: Scroll not Updating as new content is added to TextField: https://i.sstatic.net/lgOtn.png I am currently in the process of developing a live console feature within a React application and I wanted to utilize MaterialUI's TextFie ...

Error: Reading the property 'any' of an undefined object resulted in a TypeError after an update operation

After updating multiple npm packages in my application, I encountered a series of errors that I managed to resolve, except for one persistent issue! TypeError: Cannot read property 'any' of undefined at Object.<anonymous> (/home/cpt/Deskto ...

What is the process for dynamically looping through a table and adding form data to the table?

I am in the process of developing an hour tracking website that utilizes a form and a table. Currently, I have implemented the functionality where the form content gets added to the table upon the first submission. However, I need it to allow users to inp ...

Encountered an error after attempting to submit a form in Node.js - Error message reads: "Cannot

I recently integrated login/registration features into my application. When these features are used in a separate folder, they function perfectly. However, when I added them to my existing application, I encountered an error. The error occurs when I enter ...

Utilizing @ngrx/router-store in a feature module: A comprehensive guide

The NGRX documentation for Router-Store only showcases an example with .forRoot(). Upon experimenting with .forFeature(), I realized that this static method does not exist. I am interested in defining certain actions and effects to be utilized within my f ...

Whenever I attempt to generate a forecast utilizing a tensorflow.js model, I encounter the following error message: "Uncaught TypeError: Cannot read property 'length' of undefined."

I'm currently working on a project to build a website that utilizes a deep learning model for real-time sentiment analysis. However, I've encountered an issue when using the model.predict() function. It throws an error message: Uncaught TypeErro ...