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

swiper组件报错 #1649

Closed
xuxiaoxiao312 opened this issue Jul 4, 2017 · 10 comments
Closed

swiper组件报错 #1649

xuxiaoxiao312 opened this issue Jul 4, 2017 · 10 comments

Comments

@xuxiaoxiao312
Copy link

xuxiaoxiao312 commented Jul 4, 2017

之前用可以跑起来,但是今天再打开发现报错
实验发现官方示例的demo也会报错
报错内容:
TypeError: Cannot assign to read only property 'length' of function 'function from() { [native code] }'
版本号:2.4.1

@airyland
Copy link
Owner

airyland commented Jul 4, 2017

用 Chrome 看了一下并没有报错,哪个浏览器报的错?报错代码是具体哪一行?

@xuxiaoxiao312
Copy link
Author

用的是chrome,没有显示具体哪一行错,测试是slot部分有错
image

@xuxiaoxiao312
Copy link
Author

推测应该是arrayFrom函数出错。将源码中的arrayFrom相关函数注释掉,只将arrayFrom(me.$items)打印出来,如图所示,会报上面的错,全部注释且不打印则不会报错

image

@airyland
Copy link
Owner

airyland commented Jul 5, 2017

如果这里那么是 array-from 这个模块的问题,但是我 chrome 58, chrome 59 重现不了。

@xuxiaoxiao312
Copy link
Author

已经解决,应该是打包的时候出了问题,把node_modules情空,重新安装所有插件就没有问题了

@sinceow
Copy link

sinceow commented Jul 6, 2017

同样遇到这个问题
Chrome59 (64位)
"vux": "2.5.0",
"vue": "2.3.4",
"vux-loader": "1.1.0",
"vue-loader": "13.0.0"

@xuxiaoxiao312 我也清空了 node_modules 还是没用

@airyland
Copy link
Owner

airyland commented Jul 6, 2017

@sinceow 可以打包发我研究一下。

@sinceow
Copy link

sinceow commented Jul 7, 2017

@xuxiaoxiao312 @airyland 这不是Vux 的问题, 是由 webpack 3 引起的 #5135, 可以用以下方式解决

Although we can set module.strictThisContextOnImports = true to prevent the problem.

@airyland
Copy link
Owner

airyland commented Jul 7, 2017

@sinceow 原来如此,VUX 还没有更新到 webpack3。

@airyland airyland reopened this Jul 7, 2017
@airyland
Copy link
Owner

airyland commented Jul 7, 2017

vux@2.5.1-beta.2

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

No branches or pull requests

3 participants