next.js icon indicating copy to clipboard operation
next.js copied to clipboard

with-material-ui example is broken - missing dependencies

Open michaelfriedman opened this issue 8 years ago • 4 comments

When downloading, installing and running the Material UI example application, I am met with the following compile error:

These dependencies were not found:

* react-dom/lib/EventConstants in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/EventPluginHub in ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js
* react-dom/lib/EventPluginUtils in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/EventPropagators in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/SyntheticUIEvent in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/ViewportMetrics in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js

To install them, you can run: npm install --save react-dom/lib/EventConstants react-dom/lib/EventPluginHub react-dom/lib/EventPluginUtils react-dom/lib/EventPropagators react-dom/lib/SyntheticUIEvent react-dom/lib/ViewportMetrics
{ Invariant Violation: injectTapEventPlugin(): Can only be called once per application lifecycle.

It is recommended to call injectTapEventPlugin() just before you call ReactDOM.render(). If you are using an external library which calls injectTapEventPlugin() itself, please contact the maintainer as it shouldn't be called in library code and should be injected by the application.
    at invariant (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/fbjs/lib/invariant.js:42:15)
    at injectTapEventPlugin (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js:11:5)
    at Object.<anonymous> (/Users/michaelfriedman/Local/projects/with-material-ui-app/pages/index.js:14:3)
    at Module._compile (module.js:635:30)
    at Module._compile (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/source-map-support/source-map-support.js:492:25)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17) name: 'Invariant Violation', framesToPop: 1 }
{ Invariant Violation: injectTapEventPlugin(): Can only be called once per application lifecycle.

It is recommended to call injectTapEventPlugin() just before you call ReactDOM.render(). If you are using an external library which calls injectTapEventPlugin() itself, please contact the maintainer as it shouldn't be called in library code and should be injected by the application.
    at invariant (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/fbjs/lib/invariant.js:42:15)
    at injectTapEventPlugin (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js:11:5)
    at Object.<anonymous> (/Users/michaelfriedman/Local/projects/with-material-ui-app/pages/index.js:14:3)
    at Module._compile (module.js:635:30)
    at Module._compile (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/source-map-support/source-map-support.js:492:25)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17) name: 'Invariant Violation', framesToPop: 1 }
  • [x ] I have searched the issues of this repository and believe that this is not a duplicate.

Your Environment

Tech Version
next 4.2.1
node 8.9.1
OS High Sierra
browser Firefox Developer Edition
etc

michaelfriedman avatar Dec 29 '17 16:12 michaelfriedman

the same problem when I run the example project with the code create-next-app --example with-material-ui with-material-ui-app,but when I clone this repo and run the same example project, it works well.

my env: node(V8.9.1) OS(Windows 7) the package.json: default

kawhi66 avatar Mar 19 '18 08:03 kawhi66

cc @oliviertassinari

timneutkens avatar Mar 19 '18 11:03 timneutkens

Sorry guys, I have no bandwidth to help with Material-UI v0.x. We encourage new projects to start with v1-beta. We host a working integration with Next.js on Material-UI side.

oliviertassinari avatar Mar 19 '18 11:03 oliviertassinari

Sounds reasonable, going to close this then. 👌

timneutkens avatar Mar 19 '18 12:03 timneutkens