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

dev:h5编译过程正常,但打开网页报错Unexpected token , #2866

Closed
hhw28 opened this issue Apr 23, 2019 · 9 comments
Closed

dev:h5编译过程正常,但打开网页报错Unexpected token , #2866

hhw28 opened this issue Apr 23, 2019 · 9 comments
Assignees

Comments

@hhw28
Copy link

hhw28 commented Apr 23, 2019


问题描述
1、支付宝、微信小程序编辑运行一切正常
2、编译成h5,编译过程一切成功,无报错
3、但是打开h5网页报错如图

image

4、第三个报错信息中代码如下图,是有export的

image

期望行为
1、h5成功编译,并能打开网页正常运行

代码截图

1、config/index.js
image

2、src/app.js
image

系统信息
Taro CLI 1.2.26 environment info:
System:
OS: Windows 10
Binaries:
Node: 10.14.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.13.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD

@taro-bot
Copy link

taro-bot bot commented Apr 23, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@Littly
Copy link
Contributor

Littly commented Apr 23, 2019

看起来你配了路径别名?

image

@Littly Littly added the H5 label Apr 23, 2019
@taro-bot
Copy link

taro-bot bot commented Apr 23, 2019

CC @Littly

@hhw28
Copy link
Author

hhw28 commented Apr 26, 2019

看起来你配了路径别名?

image

的确配了,但是h5网页中并没有针对这个有报错

@Littly
Copy link
Contributor

Littly commented Apr 26, 2019

这个情况有可能是alias导致的,目前h5的alias实现有点问题,正在修复

@hhw28
Copy link
Author

hhw28 commented Apr 27, 2019

这个情况有可能是alias导致的,目前h5的alias实现有点问题,正在修复

我把alias注释,编译还是正常,打开浏览器查看还是同样的报错

@Littly
Copy link
Contributor

Littly commented Apr 28, 2019

image
那你从这个位置点进去截个图,看看具体的情况

@hhw28
Copy link
Author

hhw28 commented Apr 29, 2019

image
那你从这个位置点进去截个图,看看具体的情况

image

@Littly Littly closed this as completed in 3e4e89c Jul 10, 2019
@Yana5417
Copy link

请问这个问题解决了吗?我这边也是新定义了路径别名,然后报Uncaught SyntaxError: Unexpected token '<'

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

3 participants