Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught TypeError: (0 , o.default) is not a function: What's causing it?

Tags:

reactjs

In my create react app project I'm running into the following error in my production build (not in my dev build):

Uncaught TypeError: (0 , o.default) is not a function at Object.e.f.(:4444/anonymous function)...

I've been investigating this bug for a couple of hours but struggle to find out how to debug this uglified piece of js.

What makes it tough is that the error returns o.default and not SomeLibrary.default so I don't really know where to start my search really...

What does that o.default mean in this case? Any tips for figuring out what's going wrong here?

like image 547
Stiño Avatar asked Nov 01 '18 17:11

Stiño


1 Answers

It seems to be import statement somewhere in your file is incorrect.

Example: (from an issue)

// fails
import combineReducers from "redux"

// correct
import { combineReducers } from "redux"

What makes it tough is that the error returns o.default and not SomeLibrary.default so I don't really know where to start my search really...

There's nothing but exported in some library just as o. Example default export:

export default {
  o: something
}
like image 178
Bhojendra Rauniyar Avatar answered Oct 11 '22 19:10

Bhojendra Rauniyar