question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError is not a function

See original GitHub issue

Hi, thank you for this library, unfortunately I have problems with integrating it. Here is a simple component

export class Logout extends React.Component<ILogoutProps> {
  @resolve(USE_CASE_SERVICE_TYPES.AUTH_USE_CASE_HANDLER)
  private authUseCase;
......
}

Firstly, I have an error inside IDE

2018-11-21_00-46-13

I have provided an inversify container as follows

const render = Component =>
  ReactDOM.render(
    <ErrorBoundary>
      <AppContainer>
        <DiProvider container={getRootDiContainer()}>
          <Provider store={store}>
            <div>
              {/* If this slows down the app in dev disable it and enable when required  */}
              {devTools}
              <Component/>
            </div>
          </Provider>
        </DiProvider>
      </AppContainer>
    </ErrorBoundary>,
    rootEl
  );
render(AppComponent);

Unfortunately when I try to run application I get the next error

Uncaught TypeError: inversify_react__WEBPACK_IMPORTED_MODULE_4___default(...) is not a function
    at logout.tsx:12
    at Module.<anonymous> (logout.tsx:33)
    at Module../src/main/webapp/app/modules/login/logout.tsx (logout.tsx:42)
    at __webpack_require__ (bootstrap:787)
    at fn (bootstrap:150)
    at Module.<anonymous> (routes.tsx:1)
    at Module../src/main/webapp/app/routes.tsx (routes.tsx:46)
    at __webpack_require__ (bootstrap:787)
    at fn (bootstrap:150)
    at Module.<anonymous> (app.scss?d624:45)
client:77 

What could be wrong with my configuration?

Thank you so much.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Kukkimonsutacommented, Nov 22, 2018

Actually I think i see what the issue is - any chance you are doing import resolve from 'inversify-react' instead of import { resolve } from 'inversify-react'?

0reactions
Kukkimonsutacommented, Nov 25, 2018

Happy to help 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
A typographical error in a function call. · Missing script library. · When a function is called on a property that is not...
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 >
Uncaught TypeError: 'undefined' is not a function
Uncaught TypeError: 'undefined' is not a function. This is a common JavaScript error that happens when you try to call a function before...
Read more >
Uncaught Typeerror: $ Is Not a Function | Career Karma
TypeErrors can be thrown at you when attempting to modify an unchangeable value or when using a value in an inappropriate way. The...
Read more >
'X' is not a function TypeError in React [Solved] | bobbyhadz
The React.js "Uncaught TypeError: X is not a function" occurs when we try to call a value that is not a function as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found