-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
yarn dev:weapp运行报错:SyntaxError: Unexpected token export #7155
Comments
taro-bot2
bot
added
F-react
Framework - React
T-weapp
Target - 编译到微信小程序
V-3
Version - 3.x
labels
Jul 24, 2020
@hoozi 给个 demo 看看吧。 |
找到问题了,在页面的config.ts里面 加了一个import,如下: import { color } from '../../constants/color'; export default { 页面的config 不支持这种import吗?现在我把颜色直接写死了,之前是想统一在color里定义navigationBar颜色 |
目前没有做依赖分析,所以不支持。#7011 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关平台
微信小程序
复现仓库
git
小程序基础库: 2.11.2
使用框架: React
复现步骤
我在constants文件中定义了一个color json对象,
const color = {
brandColor: '#2d75ff',
brandColorTap: '#2a6ce8',
tintColor: '#fff',
textBaseColor: '#333B5A',
fillColor: '#f7f8fa',
borderColorBase: '#ebedf0',
warningColor: '#fa8c16',
successColor: '#6abf47',
errorColor: '#f4333c',
importantColor: '#ff5b05',
waitColor: '#108ee9'
}
export {
color
};
当运行yarn dev:weapp的时候,报错如下:
(node:20859) UnhandledPromiseRejectionWarning: /Users/leihu/Desktop/apply/client/src/constants/index.tsx:15
export {
^^^^^^
SyntaxError: Unexpected token export;
期望结果
实际结果
环境信息
补充信息
我在别的项目里 也一直是这么export,taro中却不行,是我哪里姿势不对吗
The text was updated successfully, but these errors were encountered: