t.apply is not a function
See original GitHub issueSteps to reproduce
Configure my store like so, following the directions here:
import { applyMiddleware, compose, createStore } from 'redux'
import thunkMiddleware from 'redux-thunk'
...
if (window.__REDUX_DEVTOOLS_EXTENSION__) {
middleware = [thunkMiddleware, window.__REDUX_DEVTOOLS_EXTENSION__()]
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
const enhancer = composeEnhancers(applyMiddleware(...middleware))
store = createStore(reducer, {}, enhancer)
}
Expected Behavior
Store is connected to both redux-thunk and redux devtools
Actual Behavior
Receive the error:
Uncaught (in promise) TypeError: t.apply is not a function
at <anonymous>:3:4545
at <anonymous>:3:985
at <anonymous>:2:838
at compose.js:29
at applyMiddleware.js:41
at <anonymous>:2:1425
at createStore (createStore.js:51)
at index.js:25
at <anonymous>
Using:
- React 16.0.0
- Redux 3.7.2
- Redux DevTools 2.15.1
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
angularjs - t.apply is not a function - Stack Overflow
I can't see where to change the code as I'm not actually using a D3 function 'apply'. The Angular code has not changed...
Read more >Callback.apply is not a function - The freeCodeCamp Forum
It means that there was a type error. Something in JS has “thrown” an error. It is saying, “When I evaluate 'callback.apply', what...
Read more >How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript error TypeError: "x" is not a function occurs when there is an attempt to call a function on a value or...
Read more >TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >Script Error: func.apply is not a function - Google Groups
The error occurs when a function call for the second time . The function loops through a list and count the occurrences of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Was able to fix this by removing
window.__REDUX_DEVTOOLS_EXTENSION__()
from the list of enhancers. Looks like thecomposeEnhancers
function will perform this step for me.This caused the error:
How @ktraff said ,we must use compose ,because we want to apply multiple ENCHANCERS:
Solution: