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

编译配置 sassLoaderOption 导致所有小程序平台编译报错 #8257

Closed
b2nil opened this issue Dec 12, 2020 · 3 comments · Fixed by #9170
Closed

编译配置 sassLoaderOption 导致所有小程序平台编译报错 #8257

b2nil opened this issue Dec 12, 2020 · 3 comments · Fixed by #9170
Assignees
Labels
F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@b2nil
Copy link
Collaborator

b2nil commented Dec 12, 2020

相关平台

所有小程序平台

复现仓库

https://github.com/b2nil/taro-ui-vue3-demo
小程序基础库: 2.14.0
使用框架: Vue 3

复现步骤

  • 新建一个 Taro 项目,或者直接 clone 上面的复现仓库到本地
  • config/index.js 中配置 sassLoaderOption:
    h5: {
        sassLoaderOption: {
            implementation: require("dart-sass")
        },
    }
  • 运行 yarn build:weapp 或其他任何小程序平台的编译命令

期望结果

小程序平台编译成功

实际结果

小程序编译失败,报以下错误:

�   编译失败.

./src/app.config.ts
Module build failed (from ./node_modules/@tarojs/mini-runner/node_modules/babel-loader/lib/index.js):
Error: Unknown option: .call$2. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
    at Array.forEach (<anonymous>)
    at loadPrivatePartialConfig.next (<anonymous>)
    at Generator.next (<anonymous>)
    at Generator.next (<anonymous>)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

环境信息

Taro CLI 3.0.16 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 12.18.1
      Yarn: 1.22.5
      npm: 6.14.5

补充信息

在编译配置的 minih5 字段下配置 sassLoaderOption,小程序平台均会编译失败,但 h5 平台可以编译成功。

不配置 sassLoaderOption,小程序平台则可编译成功。

这个问题最坑的是,h5 平台的配置,影响了小程序平台的编译,花了好长时间才排查到是这个配置导致的问题,/(ㄒoㄒ)/~~。

@taro-bot2 taro-bot2 bot added F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Dec 12, 2020
@Chen-jj Chen-jj self-assigned this Dec 14, 2020
@ppbl
Copy link

ppbl commented Dec 24, 2020

遇到同样的问题~

@Chen-jj
Copy link
Contributor

Chen-jj commented Apr 22, 2021

问题在于这里:

image

@Chen-jj
Copy link
Contributor

Chen-jj commented Apr 22, 2021

3.2.6 修复

@Chen-jj Chen-jj added this to the 3.2.6 milestone Apr 22, 2021
Chen-jj added a commit that referenced this issue Apr 25, 2021
fix(runner): 小程序编译默认使用 dart-sass,close #8257 #9151 #9107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants