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

IE8下报 “缺少标识符” 错误 #65

Closed
yaoyonstudio opened this issue Apr 26, 2018 · 6 comments
Closed

IE8下报 “缺少标识符” 错误 #65

yaoyonstudio opened this issue Apr 26, 2018 · 6 comments

Comments

@yaoyonstudio
Copy link

yaoyonstudio commented Apr 26, 2018

感谢nerv团队努力!

我使用create-react-app和react-router V4建了一个项目,修改react-scripts中关于webpack的alias配置,打包出来后,ie9, ie10都可以正常使用(在修改alias配置前试过打包项目运行,原生react在ie9和ie10下均无法使用),ie8下报了“缺少标识符”错误。

tim 20180426091824

检查了一下,是service worker的问题,去掉后,ie8下报"对象不支持此操作"错误

tim 20180426094441

@yuche
Copy link
Contributor

yuche commented Apr 26, 2018

试试使用这个:
https://github.com/NervJS/nerv-webpack-boilerplate

@yaoyonstudio
Copy link
Author

直接clone下来后,打包报错
ie9,ie10报错: 无法获取未定义或 null 引用的属性“data”

ie8报:对象不支持“setState”属性或方法

@inier
Copy link

inier commented Apr 26, 2018

【同上】
直接clone下来后,打包报错
ie9,ie10报错: 无法获取未定义或 null 引用的属性“data”

ie8报:对象不支持“setState”属性或方法

@inier
Copy link

inier commented Apr 26, 2018

直接clone下来后,打包报错
ie9,ie10报错: 无法获取未定义或 null 引用的属性“data”

ie8报:对象不支持“setState”属性或方法

如果你 采用的是npm,由于官方模版没有锁定 各个模块的版本,即没有package-lock.json
所以造成 ,npm或cnpm拉取到的库版本不同 。
解决方法:
第一种: 官方模版提供了yarn.lock ,所以 可以直接采用 yarn进行安装,该方法安装,node-sass会报错,可以采用cnpm方式安装node-sass,然后yarn build吧,好的,伙伴们,ie8就飞起来了。

第二种:建议官方提供package-lock.json。建议 各位用户在使用时,将适配的版本也提交给官方 ,官方整理为适配版本列表。ie8的确是个坑,单还有10%左右的用户,我们跳不过去,就只能勇敢地往下跳。

再次感谢Nerv团队的努力,32+

@yaoyonstudio
Copy link
Author

使用yarn安装后可以了,多谢

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

No branches or pull requests

4 participants
@yuche @inier @yaoyonstudio and others