#import less throwing ModuleBuildError in new version 3.11.0 - less

Getting build error when Use #import (less) to treat imported files as Less as below.
app.less file
#import (less) url('../node_modules/c3/c3.css');
**error**
Module build failed (from E:/ATMCodeBase/microapps/node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from E:/ATMCodeBase/microapps/node_modules/less-loader/dist/cjs.js):
}
#import (less) url('../node_modules/c3/c3.css');
^
Can't resolve '../node_modules/c3/c3.css.less' in 'E:\ATMCodeBase\microapps\apps\chart-std\src'
in E:\ATMCodeBase\microapps\apps\chart-std\src\app.less (line 17, column 4)
at runLoaders (E:\ATMCodeBase\microapps\node_modules\webpack\lib\NormalModule.js:301:20)
at E:\ATMCodeBase\microapps\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at E:\ATMCodeBase\microapps\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (E:\ATMCodeBase\microapps\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
# ./apps/chart-std/src/app.js 8:0-20
# ./src/loader/src/MicroappInstaller.js
# ./src/loader/src/MicroappLoader.js
# ./src/loader/index.js
--- if I remove (less) build is successful. In the new version we don't need to mention (less)?

Related

Node Sass Undefined variable

I'm trying to setup an existing vuejs project on AWS
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
background: $info;
^
Undefined variable: "$info".
in /var/www/html/tradeline-creditpartner/src/assets/scss/core/scafholding.scss (line 226, c olumn 17)
# ./src/assets/scss/app.scss 4:14-229 14:3-18:5 15:22-237
# ./src/main.js
# multi (webpack)-dev-server/client?http://IP:8081/sockjs-node (webpack)/hot/dev-serv er.js ./src/main.js
However when trying to serve the project
npm run serve It keeps showing the above error
Is there something wrong with vuejs installation?
that's the only error I keep encountering.

Unable to build bazel project: no such package '#io_bazel_rules_kotlin//kotlin'

OS:
daz#daz:/rom/aosp-mirror/android-test$ uname -ar
Linux daz 5.4.0-28-generic #32-Ubuntu SMP Wed Apr 22 17:40:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Building with bazel-2.2.0 with the target in the code below:
daz#daz:/rom/aosp-mirror/android-test$ bazel-2.2.0 build :axt_m2repository
I am trying to build the android-test repo here:
https://github.com/android/android-test
The definition for these rules appears to be this:
# Kotlin toolchains
rules_kotlin_version = "4c71740a1b63b785fc90afd8d4d4d5bfda527107"
http_archive(
name = "io_bazel_rules_kotlin",
sha256 = "c0ca7b66d9f466067635482592634703bf0a648d51ec958f41796d43ca8256b3",
strip_prefix = "rules_kotlin-%s" % rules_kotlin_version,
type = "zip",
urls = ["https://github.com/bazelbuild/rules_kotlin/archive/%s.zip" % rules_kotlin_version],
)
load("#io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
kotlin_repositories()
kt_register_toolchains()
But I get the following exception when trying to build:
ERROR: error loading package '': Encountered error while reading extension file 'kotlin/kotlin.bzl': no such package '#io_bazel_rules_kotlin//kotlin': error loading package 'external': Could not load //external package
The full output is here:
ERROR: /home/daz/.cache/bazel/_bazel_daz/ff62db25b941d7730a4c94ee1d6f2c41/external/robolectric/bazel/robolectric.bzl:2:5: Traceback (most recent call last):
File "/rom/aosp-mirror/android-test/WORKSPACE", line 130
robolectric_repositories()
File "/home/daz/.cache/bazel/_bazel_daz/ff62db25b941d7730a4c94ee1d6f2c41/external/robolectric/bazel/robolectric.bzl", line 381, in robolectric_repositories
android_all_jars()
File "/home/daz/.cache/bazel/_bazel_daz/ff62db25b941d7730a4c94ee1d6f2c41/external/robolectric/bazel/robolectric.bzl", line 2, in android_all_jars
native.maven_jar
no native function or rule 'maven_jar'
Available attributes: aar_import, action_listener, alias, android_binary, android_device, android_device_script_fixture, android_host_service_fixture, android_instrumentation_test, android_library, android_local_test, android_ndk_repository, android_sdk, android_sdk_repository, android_tools_defaults_jar, apple_binary, apple_cc_toolchain, apple_static_library, available_xcodes, bazel_version, bind, cc_binary, cc_host_toolchain_alias, cc_import, cc_libc_top_alias, cc_library, cc_proto_library, cc_test, cc_toolchain, cc_toolchain_alias, cc_toolchain_suite, config_feature_flag, config_setting, constraint_setting, constraint_value, environment, existing_rule, existing_rules, exports_files, extra_action, fdo_prefetch_hints, fdo_profile, filegroup, genquery, genrule, glob, j2objc_library, java_binary, java_import, java_library, java_lite_proto_library, java_package_configuration, java_plugin, java_proto_library, java_runtime, java_runtime_alias, java_test, java_toolchain, java_toolchain_alias, label_flag, label_setting, local_config_platform, local_repository, new_local_repository, ninja_build, ninja_graph, objc_import, objc_library, package_group, package_name, platform, proto_lang_toolchain, proto_library, py_binary, py_library, py_runtime, py_test, register_execution_platforms, register_toolchains, repository_name, sh_binary, sh_library, sh_test, test_suite, toolchain, toolchain_type, xcode_config, xcode_config_alias, xcode_version
ERROR: error loading package '': Encountered error while reading extension file 'kotlin/kotlin.bzl': no such package '#io_bazel_rules_kotlin//kotlin': error loading package 'external': Could not load //external package
INFO: Elapsed time: 0.061s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
WORKAROUND
Build branch:
androidx-test-1.3.0-beta01
Use bazel-2.2.0
bazel-2.2.0 build :axt_m2repository
This is the related issue in the android-test github issue tracker:
https://github.com/android/android-test/issues/626
Make sure that you're using the latest version of Bazel and the android-test repo.
The maven_jar native rule was removed in Bazel 2.0 (Bazel tracking ticket). Have you tried building with a Bazel version < 2.0 (e.g. 1.2.1)?

"Module build failed..." in Laravel Mix

I did not change anything in app.scss, but when I run npm run watch I get the following errors:
error in ./resources/sass/app.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Unsupported operation: Cannot extract a file path from a URI with a fragment component
# ./resources/sass/app.scss 2:14-254
Asset Size Chunks Chunk Names
/js/app.js 2.46 MiB /js/app [emitted] /js/app
ERROR in ./resources/sass/app.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js):
undefined
^
Join(null, "variables"): part 0 was null, but part 1 was not.
#import 'variables';
^^^^^^^^^^^
stdin 2:9 root stylesheet
in C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\resources\sass\app.scss (line 2, column 9)
at runLoaders (C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\webpack\lib\NormalModule.js:30
at C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\loader-runner\lib\LoaderRunner.js:364:11
at C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\loader-runner\lib\LoaderRunner.js:230:18
at context.callback (C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\loader-runner\lib\Loader
13)
Any help appreciated.
Finally found the issue. It is related to dart-sass being used instead of node-sass with laravel-mix v4.x.x.
Turns out something related to dart-sass or laravel-mix does not work well with paths containing a '#' symbol. In your case, your app is located at C:\Users\TAQI VAHEED\Desktop\#Coding\resPro and the #Coding folder is creating the error.
Either move your app somewhere else without a '#' symbol in the path OR enable node-sass again by following the steps from laravel-mix 4.0.0 release notes:
you can manually switch back to node-sass, like so:
npm install node-sass
mix.sass('resources/sass/app.sass', 'public/css', {
implementation: require('node-sass')
});
in your webpack.mix.js write the code
mix.js('resources/js/app.js', 'public/js')
.postCss('resources/css/app.css', 'public/css');

React-native on Android - cannot compile app

I followed all the instructions to setup Android but when I try to compile it complains it cannot find the modules required in DetoxTest.java
/Work/mine/detoxJestRn/android/app/src/main/java/com/detoxjestrn/DetoxTest.java:3: error: package android.support.test.filters does not exist
import android.support.test.filters.LargeTest;
^
/Work/mine/detoxJestRn/android/app/src/main/java/com/detoxjestrn/DetoxTest.java:4: error: package android.support.test.rule does not exist
import android.support.test.rule.ActivityTestRule;
^`
You need to add the DetoxTest.java file in the correct folder (androidTest).
For example:
$ find android/app/src -name '*.java'
android/app/src/androidTest/java/com/[your.package]/DetoxTest.java
android/app/src/main/java/com/onova/[your.package]/MainActivity.java
android/app/src/main/java/com/onova/[your.package]/MainApplication.java

Could not build module error while importing a pod in bridging-Header using cocoapods

I am getting the following error while importing a pod in bridging-Header using cocoa pods.
added use_frameworks! in podfile
/Users/harsha/Desktop/podTests/podTests/podTests-Bridging-Header.h:6:9: note: while building module 'DesignSystem' imported from /Users/harsha/Desktop/podTests/podTests/podTests-Bridging-Header.h:6:
#import <DesignSystem/PBDesignSystem.h>
^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/Users/harsha/Desktop/podTests/Build/Products/Debug-iphonesimulator/DesignSystem.framework/Headers/DesignSystem-umbrella.h"
^
/Users/harsha/Desktop/podTests/Build/Products/Debug-iphonesimulator/DesignSystem.framework/Headers/DesignSystem-umbrella.h:13:9: note: in file included from /Users/harsha/Desktop/podTests/Build/Products/Debug-iphonesimulator/DesignSystem.framework/Headers/DesignSystem-umbrella.h:13:
#import "PBDesignSystem.h"
^
/Users/harsha/Desktop/podTests/Build/Products/Debug-iphonesimulator/DesignSystem.framework/Headers/PBDesignSystem.h:10:9: error: 'PBDesignSystem/PBFont.h' file not found
#import <PBDesignSystem/PBFont.h>
^
/Users/harsha/Desktop/podTests/podTests/podTests-Bridging-Header.h:6:9: error: could not build module 'DesignSystem'
#import <DesignSystem/PBDesignSystem.h>
^
<unknown>:0: error: failed to import bridging header '/Users/harsha/Desktop/podTests/podTests/podTests-Bridging-Header.h'