react-swipes icon indicating copy to clipboard operation
react-swipes copied to clipboard

初始化报错

Open lazyTai opened this issue 8 years ago • 15 comments

image

lazyTai avatar Oct 20 '17 09:10 lazyTai

× TypeError: Cannot read property 'shape' of undefined module.exports C:/Users/lmt/Desktop/project/project1/node_modules/[email protected]@react-swipes/dist/react-swipes.js:158 155 | }(_react.Component); 156 | 157 | ReactSwipes.propTypes = {

158 | swipeOptions: _react.PropTypes.shape({ 159 | distance: _react.PropTypes.number, 160 | currentPoint: _react.PropTypes.number, 161 | // continuous: PropTypes.bool, View compiled webpack_require C:/Users/lmt/Desktop/project/project1/node_modules/[email protected]@react-swipes/dist/react-swipes.js:30 27 | // }; 28 | 29 | // // Execute the module function 30 | // modules[moduleId].call(module.exports, module, module.exports, webpack_require); 31 | 32 | // // Flag the module as loaded 33 | // module.loaded = true; View compiled defineProperty.value C:/Users/lmt/Desktop/project/project1/node_modules/[email protected]@react-swipes/dist/react-swipes.js:50 47 | // webpack_require.p = ""; 48 | 49 | // // Load entry module and return exports 50 | // return webpack_require(0); 51 | // }) 52 | // 53 | // ([ View compiled (anonymous function) C:/Users/lmt/Desktop/project/project1/node_modules/[email protected]@react-swipes/dist/react-swipes.js:53 50 | // return webpack_require(0); 51 | // }) 52 | // 53 | // ([ 54 | / 0 / 55 | // function(module, exports, webpack_require) { 56 | View compiled webpackUniversalModuleDefinition C:/Users/lmt/Desktop/project/project1/node_modules/[email protected]@react-swipes/dist/react-swipes.js:3 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(require("react")); 4 | else if(typeof define === 'function' && define.amd) 5 | define("ReactSwipes", ["react"], factory); 6 | else if(typeof exports === 'object') View compiled ./node_modules/[email protected]@react-swipes/dist/react-swipes.js C:/Users/lmt/Desktop/project/project1/node_modules/[email protected]@react-swipes/dist/react-swipes.js:10 7 | exports["ReactSwipes"] = factory(require("react")); 8 | else 9 | root["ReactSwipes"] = factory(root["React"]); 10 | })(this, function(WEBPACK_EXTERNAL_MODULE_1) { 11 | return // (function(modules) { // webpackBootstrap 12 | // // The module cache 13 | /***/ var installedModules = {}; View compiled webpack_require C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:669 666 | }; 667 | 668 | // Execute the module function 669 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); 670 | 671 | // Flag the module as loaded 672 | module.l = true; View compiled fn C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:87 84 | console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId); 85 | hotCurrentParents = []; 86 | } 87 | return webpack_require(request); 88 | }; 89 | var ObjectFactory = function ObjectFactory(name) { 90 | return { View compiled ./src/component/home/swiper.js http://localhost:3000/static/js/bundle.js:64760:71 webpack_require C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:669 666 | }; 667 | 668 | // Execute the module function 669 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); 670 | 671 | // Flag the module as loaded 672 | module.l = true; View compiled fn C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:87 84 | console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId); 85 | hotCurrentParents = []; 86 | } 87 | return webpack_require(request); 88 | }; 89 | var ObjectFactory = function ObjectFactory(name) { 90 | return { View compiled ./src/component/home/home.js http://localhost:3000/static/js/bundle.js:64693:69 webpack_require C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:669 666 | }; 667 | 668 | // Execute the module function 669 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); 670 | 671 | // Flag the module as loaded 672 | module.l = true; View compiled fn C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:87 84 | console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId); 85 | hotCurrentParents = []; 86 | } 87 | return webpack_require(request); 88 | }; 89 | var ObjectFactory = function ObjectFactory(name) { 90 | return { View compiled ./src/App.js http://localhost:3000/static/js/bundle.js:64585:82 webpack_require C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:669 666 | }; 667 | 668 | // Execute the module function 669 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); 670 | 671 | // Flag the module as loaded 672 | module.l = true; View compiled fn C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:87 84 | console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId); 85 | hotCurrentParents = []; 86 | } 87 | return webpack_require(request); 88 | }; 89 | var ObjectFactory = function ObjectFactory(name) { 90 | return { View compiled ./src/index.js http://localhost:3000/static/js/bundle.js:65271:63 webpack_require C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:669 666 | }; 667 | 668 | // Execute the module function 669 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); 670 | 671 | // Flag the module as loaded 672 | module.l = true; View compiled fn C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:87 84 | console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId); 85 | hotCurrentParents = []; 86 | } 87 | return webpack_require(request); 88 | }; 89 | var ObjectFactory = function ObjectFactory(name) { 90 | return { View compiled 0 http://localhost:3000/static/js/bundle.js:65409:18 webpack_require C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:669 666 | }; 667 | 668 | // Execute the module function 669 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); 670 | 671 | // Flag the module as loaded 672 | module.l = true; View compiled (anonymous function) C:/Users/lmt/Desktop/project/project1/webpack/bootstrap 4f4f27e6a0bbbf1e0da2:715 712 | webpack_require.h = function() { return hotCurrentHash; }; 713 | 714 | // Load entry module and return exports 715 | return hotCreateRequire(0)(webpack_require.s = 0); 716 | 717 | 718 | View compiled (anonymous function) http://localhost:3000/static/js/bundle.js:719:10 This screen is visible only in development. It will not appear if the app crashes in production. Open your browser’s developer console to further inspect this error.

lazyTai avatar Oct 20 '17 09:10 lazyTai

@lazyTai 一样的错误,你解决了吗?

nykee avatar Dec 05 '17 07:12 nykee

@lazyTai @nykee 你们的react 及 webpack版本是多少,我试一下

younth avatar Dec 06 '17 01:12 younth

@younth 我的react是16.0.0,webpack 是3.8.1

nykee avatar Dec 06 '17 02:12 nykee

@younth 有没有联系方式啊,gayhub交流不是很方便

nykee avatar Dec 06 '17 04:12 nykee

一样的错

JoeyCurry avatar Dec 07 '17 13:12 JoeyCurry

"react": "16.1.1", "webpack": "3.8.1",

JoeyCurry avatar Dec 07 '17 13:12 JoeyCurry

React.PropTypes has moved into a different package since React v15.5. Please use the prop-types library instead.

npm install --save prop-types

import PropTypes from 'prop-types';

把项目clone下来,然后按照上面👆的修改,然后打包,将打包后的文件在node_modules里替换就可以了 @lazyTai @nykee 建议 @younth 把react版本升起来吧

JoeyCurry avatar Dec 07 '17 13:12 JoeyCurry

一样,我也是报这个错误,用不了

lusanshao avatar Mar 21 '18 07:03 lusanshao

@lusanshao 已经升级了react到 16.2.0 , 应该没问题了。。

younth avatar Mar 21 '18 08:03 younth

@JoeyCurry 已经升级了,不好意思,处理慢了

younth avatar Mar 21 '18 08:03 younth

@nykee 已经升级react了,希望还能帮助到你。

younth avatar Mar 21 '18 08:03 younth

拉最新的,就好了。thanks @younth

songyule avatar Mar 21 '18 08:03 songyule

@songyule 应该的,这个升级来晚了,让大家困扰了...

younth avatar Mar 21 '18 08:03 younth

哈哈。不晚不晚,我刚好发现这个报错,然后看了眼issues,就发现你在更新了。 @younth

songyule avatar Mar 21 '18 08:03 songyule