Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'injection' of undefined #123

Closed
ghost opened this issue Sep 11, 2018 · 7 comments
Closed

Uncaught TypeError: Cannot read property 'injection' of undefined #123

ghost opened this issue Sep 11, 2018 · 7 comments

Comments

@ghost
Copy link

ghost commented Sep 11, 2018

I've just been assigned to a project which makes use of this plugin, the project works fine on other members' machine, but on my machine it is throwing the error mentioned in title.

The version number of React and React-DOM is 16.0.36 and 16.0.3 respectively.

So, based on readme.md this plugin should be supported.

The error looks like the following:

react-event-tap-error

As of now, I've put the function call injectTpEventPlugin(); in a try-catch block, so that the project can at least be run.

@paulincai
Copy link

Could you please let me know how and where you initialize the plugin in JS.

@ghost
Copy link
Author

ghost commented Sep 11, 2018

It is initialized in index.js file, the code looks like the following:

code-error-react-event-tap

@paulincai
Copy link

Would you please try to first fix the misspelling in the function name just to make sure there is no issue there.

@ghost
Copy link
Author

ghost commented Sep 11, 2018

Sorry, my mistake! but I changed the spelling to injectTapEventPlugin and still the same error is persisting.

@paulincai
Copy link

Ok, not sure what this might be, I cannot reproduce when I remove various things like jquery.
If you say it works fine on other machines, I'd look at the local NPM setup in the packages.json and in the local NPM on the machine. It may be that your jquery version is newer. The rest of the error you have related to jquery was introduced in the past as a result of a breaking change in a new jquery version. That might be the issue. Anyway, if the exact same project works on a different machine, clearly the code is valid, I'd say. So ... NPMs...

@ghost
Copy link
Author

ghost commented Sep 11, 2018

I was just doing trial and error and i commented out the function call and I moved it in

if (module.hot) {
  module.hot.accept('./containers/app/App', () => {
    injectTapEventPlugin();
    const RootComponent = require('./containers/app/App').default;
    renderApp(RootComponent);
  });
}

And it has started working don't know how, but it's working now. Anyway thanks for the cooperation.

@ghost ghost closed this as completed Sep 11, 2018
@paulincai
Copy link

thumb_my-code-doesnt-work-ihave-no-idea-why-my-code-works-14032925

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant