Build fails on older Git branch after checking out another with build.gradle specifying newest version of Sass jar - ruby

I upgraded my local Compass and Sass to their latest versions and fixed some errors caused by deprecated code per the latest Sass (3.4.9). I checked those into a branch and the changes include updating a build.gradle file in which it specifies a Sass jar also of the latest version (This was created and uploaded to nexus by another co-worker). For testing, I had another co-worker, who is using an older version of Sass, check out my branch. It built fine. But when he switched back to another branch, it failed, showing the same errors I got after I updated Sass. We verified he is still using Sass 3.2.1. I had him remove a cached file (sass-3.4.9.gem) and directory (sass-3.4.9). The build still failed. I'm not at all familiar with build.gradle files and such. I'm hoping anyone has insight on what happened and how to fix this.
EDIT: Below are two error examples. All the other errors I get refer to not being able to extend a class -
Building > :compileSassWARNING: The compass/css3/box module is DEPRECATED and will be removed in the next release. Please use compass/css3/flexbox instead.
on line 4 of /Library/Ruby/Gems/1.8/gems/compass-core-1.0.1/stylesheets/compass/css3/_box.scss
from line 11 of /Users/sueannaj/dev/workspace/zephyr_css/scss/sass/shared/includes/_imports.scss
from line 14 of /Users/sueannaj/dev/workspace/zephyr_css/scss/sass/twitter-main.scss
error scss/sass/t-store-main.scss (Line 6 of scss/sass/touch/modules/sub/_default-buttons.scss: ".button-group" failed to #extend ".tabbed-layout".
The selector ".tabbed-layout" was not found.
Use "#extend .tabbed-layout !optional" if the extend should be able to fail.
For reference, I'm on Mac 10.8.5 and ruby 1.8.7. Someone here figured a fix, and I will answer my own question.

There were two cached files and one directory that needed removing -
~/.gradle/caches
.gradle
build
The last two, .gradle and build, live in the project directory. .gradle/caches is in the user's home directory.

Related

Xcode error "Dependencies could not be resolved", but only when building via command line

I have a project that builds perfectly fine from within Xcode, but it fails when I want to run it from the command line. I get this error:
error: Dependencies could not be resolved because no versions of 'pathkit' match the requirement 1.0.1..<2.0.0 and root depends on 'saga' 1.1.3..<2.0.0. 'saga' >= 1.1.3 practically depends on 'pathkit' 1.0.1..<2.0.0 because 'saga' 1.1.3 depends on 'pathkit' 1.0.1..<2.0.0 and no versions of 'saga' match the requirement 1.1.4..<2.0.0.
I'm not sure what's going on, as pathkit 1.0.1 exist and works fine. Here's a screenshot from Xcode, where I have no problems at all:
I've already removed all derived data.
In the end I removed the project, did a clean checkout from git, and now it works again 🤷‍♂️

go get fetching a pre-release version always

I am trying to wrap my head around go modules. This is what I have done so far.
Created a simple module and published it as 0.0.1 on github.
Referenced the above mentioned module in a separate go project and used it.
so far it works fine. Now I update the initial module to 0.0.2 and publish it as a release on github. Now when I try go get <published module> it still seems to fetch the original 0.0.1 version and run it. I also deleted all references to 0.0.1 including in go.mod and go.sum and run go get and it still fetches the original 0.0.1 version instead of 0.0.2.
I also tried publishing a major version 1.0.0 and tried to use it, but its still fetching the older 0.0.1 version. I thought it will automatically fetch the latest version and use that.
My go.mod file also shows the following even for the major version
require github.com/user/module v0.0.0-20210223020204-1b5fb712826f // indirect
I feel there could be something wrong in the way its being published on git. Any help, anyone.
It looks like the comments already highlighted the required steps to take, but to capture the information in an answer, here is the relevant snippet from go help get
The -u flag instructs get to use the network to update the named packages
and their dependencies. By default, get uses the network to check out
missing packages but does not use it to look for updates to existing packages.
Basically, go get will only fetch the versions locked in your go.{mod,sum} files and you need to explicitly ask for updates using one of:
# upgrade to the latest release
go get -u github.com/user/module
# upgrade to a specific version
go get github.com/user/module#2.0.0
# use the `latest` version alias
go get github.com/user/module#latest

SublimeLinter ESLint couldn't find the plugin

When editing javascript files in Sublime Text Editor 3.x, I get the error:
Oops! Something went wrong! :(
ESLint: 6.0.1.
ESLint couldn't find the plugin "eslint-plugin-chai-expect".
(The package "eslint-plugin-chai-expect" was not found when loaded as a Node module from the directory "C:\workspace\flltools".)
It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
npm install eslint-plugin-chai-expect#latest --save-dev
The plugin "eslint-plugin-chai-expect" was referenced from the config file in "modules\scoring\.eslintrc.yml".
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
I tried multiple solutions I found online, including removing global ESLint/moving all ESLint related packages to be global, to altering the SublimeLinter.settings file. The problem only occours when running lint through Sublime. When I run eslint command, it works perfectly.
If anyone has any idea why this is happenning please help me!
Thank you
As far as I can tell this is indeed a problem with migrating to ESLint v6. But it's not a global installation problem.
The problem is now that ESLint looks in the working directory where the eslint command is run from. As you say in your comment:
It seems to be looking in a parent folder (as you can see in the error it's looking in c:/workspace/flltools, whereas my project is in c:/workspace/flltools/modules/scoring
So your editor is running eslint in the parent directory rather than in the directory where the package.json file is. I'm guessing your editor has the project root one level higher than where the package.json file is.
It does look like this has now been patched in the SublimeLinter plugin via github issue #1626: Wrong working directory on nested local eslint installs (breaks eslint#6)
Note that I have similar issues with both VSCode and Vim, so it's not a specifically a Sublime Text thing, more just an ESLint thing.
In the ESLint v6 migration doc, it has a section on "Plugins and shareable configs are no longer affected by ESLint’s location". It suggests:
If you use a config file located outside of a local project (with the --config flag), consider installing the plugins as dependencies of that config file, and setting the --resolve-plugins-relative-to flag to the location of the config file.
This --resolve-plugins-relative-to will fix the problem in that you can specify the path to where the package.json is inside there.
Most probably you have updated your ESLint to v6.
As per Migrating to 6.0 Docs
If you use a global installation of ESLint (e.g. installed with npm install eslint --global) along with plugins.
Then you should install those plugins locally in the projects where you run ESLint.
In your case, Install eslint-plugin-chai-expect and other plugins(if used) as devDependencies locally to your project.
npm install --save-dev eslint-plugin-chai-expect
If your config file extends shareable configs and/or parsers, you should ensure that those packages are installed as dependencies of the project containing the config file.

How to install a NativeScript plugin from a forked repository?

I currently need to use the nativescript-https plugin but its repository is not updated and not packed to npm and it has a couple bugs (including one with AFNetworking with version) without a solution so I've forked the repository and try to add from this forked repo using:
tns pluging add [url of the repo]
this install the plugin with no errors, but when I try to run the app it shows the following error:
NativeScript encountered a fatal error: Error: Could not find module 'nativescript-https'
So I would like to know... which is the correct workflow to do this?
Compile and add the plugin folder to your package.json using relative path.
"myplugin": "file:myplugin/dist"
Assuming myplugin is your plugin folder placed at your project root, dist is where you have your compiled JS files.
The error wasn't related to the plugin installation, the problem was that I needed to run Typescript compiler on plugin's folder to generate the .js files.

Yarn upgrade - Is the new version saved?

Say I have a package.json file in an existing project. In there I have "some-package": "^1.0-01",, however I know that the latest version is 1.0-02
So I do yarn upgrade. However, package.json is not update, and still references the -01 version. The yarn.lock file however shows this:
some-package#^1.0-01:
version "1.0-02"
Is this expected behavior? When someone else does the yarn command, which version will they get. If they get the latest version, isn't it misleading to show -01 in package.json?
According to the documentation here,
yarn upgrade
This command updates all dependencies to their latest version based on
the version range specified in the package.json file. The yarn.lock
file will be recreated as well.
The tricky part is based on the version range specified in the package.json
This means that if your package.json has defined a particular semver like you've said, upgrade will only upgrade it according to the range defined there, i.e. ^1.0-01 should upgrade to 1.0-02 in both your package.json and yarn.lock files.
Now you've said that this is happening only in your yarn.lock file. Yarn provides a utility for checking for such clashes called check
Could you try running
yarn check
in your repository and tell us your findings?

Resources