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

wepy-cli 升级到 1.5.8 编译 scss 报错 #303

Closed
cmzz opened this issue Aug 5, 2017 · 16 comments
Closed

wepy-cli 升级到 1.5.8 编译 scss 报错 #303

cmzz opened this issue Aug 5, 2017 · 16 comments
Labels
inactive Inactive issue, will be auto closed in 7 days

Comments

@cmzz
Copy link

cmzz commented Aug 5, 2017

{ Error: Invalid CSS after ".f8 {": expected "}", was "{"
    at options.error (/Users/steve/www/xiaochengxu-projects/weapp-pigtk/node_modules/node-sass/lib/index.js:291:26)
  status: 1,
  file: '/Users/steve/www/xiaochengxu-projects/weapp-pigtk/src/assets/scss/base.scss',
  line: 3,
  column: 6,
  message: 'Invalid CSS after ".f8 {": expected "}", was "{"',
  formatted: 'Error: Invalid CSS after ".f8 {": expected "}", was "{"\n        on line 3 of src/assets/scss/base.scss\n>> .f8 { {\n   -----^\n' }

代码: base.scss

.f8 {
  font-size: 16rpx !important;
}
.f9 {
  font-size: 18rpx !important;
}

app.wpy

<style lang="scss">
  @import "assets/scss/base.scss";
</style>
@cmzz
Copy link
Author

cmzz commented Aug 5, 2017

1.5.7 正常, 只能暂时先换回去了

@leCapsimRy
Copy link

同问题,bug会在1.5.9中改动还是对1.5.8直接调整?

@coolhwm
Copy link

coolhwm commented Aug 7, 2017

同问题

@Gcaufy
Copy link
Collaborator

Gcaufy commented Aug 7, 2017

wepyjs/wepy-wechat-demo@d85fae6
刚把这个使用sass的项目升级成为1.5.8了,没有发现有任何问题。
或者谁能提供一份简单的实例代码发给我参考一下。

@Gcaufy
Copy link
Collaborator

Gcaufy commented Aug 7, 2017

@leCapsimRy
如果其它模块的BUG,如 wepy-compilers-sass, 那么直接发布一下这个模块就可以了,
如果是wepy-cli的BUG,并且影响到用户正常使用,那么紧急发布下个版本。

@leCapsimRy
Copy link

ok
我这边可以了,把lang="sass"改成“scss”就编译过去了,出现这个问题的可以试下

@leCapsimRy
Copy link

@Gcaufy
好的 我这边问题已经解决了 感谢解答

@cmzz
Copy link
Author

cmzz commented Aug 7, 2017

@leCapsimRy 我的已经是 lang="scss"

Gcaufy added a commit that referenced this issue Aug 9, 2017
@Gcaufy
Copy link
Collaborator

Gcaufy commented Aug 9, 2017

@cmzz 找到问题了,问题是使用import xxx.scss 时,还是按sass的方式编译去了。所有有两种解决方案。

  1. scss格式文件改成sass文件。
  2. 不使用import, 直接写在单文件里。
  3. 参照上述commit修改一行代码。

@cz848
Copy link

cz848 commented Aug 11, 2017

改了之后报错,文件为scss
{ SyntaxError: unknown: Unexpected token (1:0)

1 | .member-card {
| ^
2 | .card {
3 | position: relative;
4 | width: 335 * 2rpx;
at Parser.pp$5.raise (/.../node_modules/babylon/lib/index.js:4454:13)
at Parser.pp.unexpected (/.../node_modules/babylon/lib/index.js:1761:8)
at Parser.pp$3.parseExprAtom (/.../node_modules/babylon/lib/index.js:3750:12)
at Parser.pp$3.parseExprSubscripts (/.../node_modules/babylon/lib/index.js:3494:19)
at Parser.pp$3.parseMaybeUnary (/.../node_modules/babylon/lib/index.js:3474:19)
at Parser.pp$3.parseExprOps (/.../node_modules/babylon/lib/index.js:3404:19)
at Parser.pp$3.parseMaybeConditional (/.../node_modules/babylon/lib/index.js:3381:19)
at Parser.pp$3.parseMaybeAssign (/.../node_modules/babylon/lib/index.js:3344:19)
at Parser.pp$3.parseExpression (/.../node_modules/babylon/lib/index.js:3306:19)
at Parser.pp$1.parseStatement (/.../node_modules/babylon/lib/index.js:1906:19)
pos: 0,
loc: Position { line: 1, column: 0 },
_babel: true,
codeFrame: '\u001b[0m\u001b[31m\u001b[1m>\u001b[22m\u001b[39m\u001b[90m 1 | \u001b[39m\u001b[33m.\u001b[39mmember\u001b[33m-\u001b[39mcard {\n \u001b[90m | \u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\n \u001b[90m 2 | \u001b[39m \u001b[33m.\u001b[39mcard {\n \u001b[90m 3 | \u001b[39m position\u001b[33m:\u001b[39m relative\u001b[33m;\u001b[39m\n \u001b[90m 4 | \u001b[39m width\u001b[33m:\u001b[39m \u001b[35m335\u001b[39m \u001b[33m*\u001b[39m \u001b[35m2\u001b[39mrpx\u001b[33m;\u001b[39m\u001b[0m' }

@Gcaufy
Copy link
Collaborator

Gcaufy commented Aug 11, 2017

参考一下我上面的回复

dlhandsome pushed a commit to dlhandsome/wepy that referenced this issue Aug 16, 2017
@afarwind
Copy link

@Gcaufy 目前npm上直接安装的wepy-cli 1.5.8仍然存在这个问题,不过我参照你的上面的回复中的commit已经自己改了,希望有时间可以更新下npm上的包,谢谢……

@Gcaufy
Copy link
Collaborator

Gcaufy commented Aug 18, 2017

预计下周或者下下周可能会发一个大版本

@iuphero
Copy link

iuphero commented Aug 23, 2017

@Gcaufy 希望尽快更新npm, 换掉1.5.8 👍

@Gcaufy
Copy link
Collaborator

Gcaufy commented Aug 24, 2017

@HappyHero0 可以升级成 npm install wepy-cli@1.5.9-0

@stale
Copy link

stale bot commented Jun 13, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
因为这个 Issue 最近没有任何有效回复,所以被自动标记为了stale。 如果在未来7天依旧没有任何激活操作,那么该 Issue 将会被自动关闭。 感谢您的提问。

@stale stale bot added the inactive Inactive issue, will be auto closed in 7 days label Jun 13, 2018
@stale stale bot closed this as completed Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive Inactive issue, will be auto closed in 7 days
Projects
None yet
Development

No branches or pull requests

7 participants