zilverline / react-tap-event-plugin

Instant TapEvents for React
http://facebook.github.io/react/
MIT License
1.07k stars 110 forks source link

Does not work with minified version of react-dom #99

Open zabojad opened 7 years ago

zabojad commented 7 years ago

The onTouchTap callbacks do not get raised anymore when we pack our react js app with the minified version of react-dom: react-dom.min.js.

Everything else seems to work fine to is it rather a react-tap-event-plugin bug or a react-dom bug ?

JedrzejMajko commented 7 years ago

Very easy to reproduce: package.json: { "name": "web", "version": "0.0.1", "private": true, "description": "Web ", "keywords": [], "author": "", "license": "", "main": "app.js", "dependencies": { "material-ui": "^0.18.0", "next": "^2.3.1", "react": "^15.5.4", "react-tap-event-plugin": "^2.0.1", "react-dom": "^15.5.4" }, "devDependencies": {}, "scripts": { "dev": "next", "build": "next build", "start": "next start" } } then in command line: mkdir pages; npm install

Create index.js in pages with this line: import injectTapEventPlugin from 'react-tap-event-plugin';

result of npm run build: `

Failed to build on /var/folders/dw/qrjcn17d09532ndl_phmd4800000gn/T/d42a856c-b5fe-45be-ab4f-33da2590c40a { Error: ./~/react-tap-event-plugin/src/injectTapEventPlugin.js Module not found: Error: Can't resolve 'react-dom/lib/EventPluginHub' in '/ProjectBase/node_modules/react-tap-event-plugin/src' resolve 'react-dom/lib/EventPluginHub' in '/ProjectBase/node_modules/react-tap-event-plugin/src' Parsed request is a module using description file: /ProjectBase/node_modules/react-tap-event-plugin/package.json (relative path: ./src) Field 'browser' doesn't contain a valid alias configuration aliased with mapping 'react-dom': '/ProjectBase/node_modules/react-dom/dist/react-dom.min.js' to '/ProjectBase/node_modules/react-dom/dist/react-dom.min.js/lib/EventPluginHub' using description file: /ProjectBase/node_modules/react-tap-event-plugin/package.json (relative path: ./src) Field 'browser' doesn't contain a valid alias configuration after using description file: /ProjectBase/node_modules/react-tap-event-plugin/package.json (relative path: ./src) using description file: /ProjectBase/node_modules/react-dom/package.json (relative path: ./dist/react-dom.min.js/lib/EventPluginHub) as directory /ProjectBase/node_modules/react-dom/dist/react-dom.min.js/lib/EventPluginHub doesn't exist no extension Field 'browser' doesn't contain a valid alias configuration /ProjectBase/node_modules/react-dom/dist/react-dom.min.js/lib/EventPluginHub doesn't exist .js Field 'browser' doesn't contain a valid alias configuration /ProjectBase/node_modules/react-dom/dist/react-dom.min.js/lib/EventPluginHub.js doesn't exist .json Field 'browser' doesn't contain a valid alias configuration /ProjectBase/node_modules/react-dom/dist/react-dom.min.js/lib/EventPluginHub.json doesn't exist`

mikearnaldi commented 7 years ago

Downgrading to next@2.1.1 solves the issue apparently something is not going well with next

mikearnaldi commented 7 years ago

Related discussion in next.js repo https://github.com/zeit/next.js/issues/1877