zilverline/react-tap-event-plugin

Uncaught TypeError: Cannot read property 'injection' of undefined

Closed this issue · 7 comments

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.

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

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

code-error-react-event-tap

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

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

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...

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.

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