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

cli创建的项目安装最新版本的sass会有问题 #776

Closed
lijibing01 opened this issue Sep 12, 2019 · 5 comments
Closed

cli创建的项目安装最新版本的sass会有问题 #776

lijibing01 opened this issue Sep 12, 2019 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@lijibing01
Copy link

问题描述
cli创建的项目安装最新版本的sass会报错

复现步骤
[复现问题的步骤]

  1. cli创建项目
  2. yarn add node-sass --dev
  3. yarn add sass-loader --dev

预期结果
在页面上能使用scss语法

实际结果
image

会报webpack错误,而安装旧版本的就不会报错
"node-sass": "^4.9.4",
"sass-loader": "^7.1.0",

@fxy060608 fxy060608 self-assigned this Sep 12, 2019
@fxy060608 fxy060608 added the bug Something isn't working label Sep 12, 2019
@fxy060608
Copy link
Collaborator

下次版本更新修复此问题
sass-loader v8 版本选项配置把 data 修改为了 prependData,暂时可以锁定 v7 版本

@zhangzhenfei
Copy link

Module build failed (from ./node_modules/_mini-css-extract-plugin@0.8.0@mini-css-extract-plugin/dist/loader.js):
12:29:25.622 ModuleBuildError: Module build failed (from ./node_modules/_sass-loader@7.3.1@sass-loader/dist/cjs.js):
12:29:25.658 Error: Missing binding /Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_node-sass@4.13.0@node-sass/vendor/darwin-x64-57/binding.node
12:29:25.659 Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 8.x
12:29:25.666 Found bindings for the following environments:
12:29:25.667 - OS X 64-bit with Node.js 12.x
12:29:25.673 This usually happens because your environment has changed since running npm install.
12:29:25.682 Run npm rebuild node-sass to download the binding for your current environment.
12:29:25.682 at module.exports (/Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_node-sass@4.13.0@node-sass/lib/binding.js:15:13)
12:29:25.690 at Object. (/Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_node-sass@4.13.0@node-sass/lib/index.js:14:35)
12:29:25.700 at Module._compile (module.js:652:30)
12:29:25.709 at Object.Module._extensions..js (module.js:663:10)
12:29:25.709 at Module.load (module.js:565:32)
12:29:25.720 at tryModuleLoad (module.js:505:12)
12:29:25.721 at Function.Module._load (module.js:497:3)
12:29:25.731 at Module.require (module.js:596:17)
12:29:25.732 at require (internal/module.js:11:18)
12:29:25.740 at getDefaultSassImpl (/Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_sass-loader@7.3.1@sass-loader/dist/index.js:198:10)
12:29:25.741 at Object.loader (/Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_sass-loader@7.3.1@sass-loader/dist/index.js:80:29)
12:29:25.752 at runLoaders (/Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_webpack@4.41.2@webpack/lib/NormalModule.js:316:20)
12:29:25.752 at /Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:367:11
12:29:25.763 at /Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:233:18
12:29:25.773 at runSyncOrAsync (/Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:143:3)
12:29:25.784 at iterateNormalLoaders (/Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:232:2)
12:29:25.797 at iterateNormalLoaders (/Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:221:10)
12:29:25.797 at /Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:236:3
12:29:25.808 at Object.context.callback (/Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:111:13)
12:29:25.808 at Object.module.exports (/Users/zhenfeizhang/workspace/uni-app/uniapp-startkit/node_modules/
@dcloudio_vue-cli-plugin-uni@2.0.0-24220191115006@@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js:60:10)
12:29:25.825 [tsl] ERROR at App.vue:4
12:29:25.825 TS2769:No overload matches this call.
12:29:25.839 The last overload gave the following error.
12:29:25.839 Argument of type '{ mpType: string; onLaunch(): void; onShow(): void; onHide(): void; }' is not assignable to parameter of type 'ComponentOptions<Vue, DefaultData, DefaultMethods, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>'.
12:29:25.853 Object literal may only specify known properties, and 'mpType' does not exist in type 'ComponentOptions<Vue, DefaultData, DefaultMethods, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>'.
12:29:25.854 [tsl] ERROR at pages/index/index.vue:18
12:29:25.894 TS2769:No overload matches this call.
12:29:25.907 The last overload gave the following error.
12:29:25.925 Argument of type '{ data(this: CombinedVueInstance<Vue, unknown, {}, unknown, Readonly<Record<never, any>>>): { title: string; }; onLoad(): void; methods: {}; }' is not assignable to parameter of type 'ComponentOptions<Vue, DefaultData, DefaultMethods, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>'.
12:29:25.926 Object literal may only specify known properties, and 'onLoad' does not exist in type 'ComponentOptions<Vue, DefaultData, DefaultMethods, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>'.
12:29:25.939 [tsl] ERROR at pages/login/index.vue:18
12:29:25.939 TS2769:No overload matches this call.
12:29:25.952 The last overload gave the following error.
12:29:25.952 正在启动模拟器...
12:29:25.952 Argument of type '{ data(this: CombinedVueInstance<Vue, unknown, {}, unknown, Readonly<Record<never, any>>>): {}; onLoad(): void; methods: {}; }' is not assignable to parameter of type 'ComponentOptions<Vue, DefaultData, DefaultMethods, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>'.
12:29:25.966 Object literal may only specify known properties, and 'onLoad' does not exist in type 'ComponentOptions<Vue, DefaultData, DefaultMethods, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>'.
12:29:25.980 ERROR Build failed with errors.
12:29:31.194 正在安装手机端HBuilder调试基座...

@zhangzhenfei
Copy link

使用script命令可以跑,在hbuilderx里面运行报错

@ianho7
Copy link

ianho7 commented May 14, 2020

使用script命令可以跑,在hbuilderx里面运行报错

你好,请问解决了吗😂?

@zhangzhenfei
Copy link

使用script命令可以跑,在hbuilderx里面运行报错

你好,请问解决了吗😂?

已修复,另外在Hbuilderx中,需要指定运行环境,node => 为本机安装node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants