sbt: Getting error output from an external process (yarn)
We run into a problem with 'yarn build' command run from build.sbt:
println(Process("yarn build", frontEndFile).!!)
The output is just:
[info] yarn build 3456
[error] java.lang.RuntimeException: Nonzero exit value: 1
But we don't see the acutal error output from yarn. How can we get that error output from the yarn process?
do you know?
how many words do you know
See also questions close to this topic
-
Cannot pass arguments using sbt to gatling simulation
Regarding to Gatling SBT execute a specific simulation topic is there any way to pass argument to simulation?
I've been trying passing command from any CLI like:
sbt -Dx=1 -Dy=2 -Dz=3 "gatling:testOnly fooSimulation"
and:
sbt "-Dx=1 -Dy=2 -Dz=3 gatling:testOnly fooSimulation"
and all similar variations, but in result it gives just a null value.
Same thing I was trying to do in sbt shell, because I use it as well, but no success at all. Maybe my specific configuration in build.sbt is the main reason why it doesn't work. Nevertheless I do not want to pass the arguments in config file, it should be dynamic.
build.sbt
name := "Gatling" version := "0.1" scalaVersion := "2.12.11" enablePlugins(GatlingPlugin) fork := true scalacOptions := Seq( "-encoding", "UTF-8", "-target:jvm-1.8", "-deprecation", "-feature", "-unchecked", "-language:implicitConversions", "-language:postfixOps") libraryDependencies += "io.gatling.highcharts" % "gatling-charts-highcharts" % "3.3.1" % Test libraryDependencies += "io.gatling" % "gatling-test-framework" % "3.3.1" % Test libraryDependencies += "org.json4s" % "json4s-native_2.12" % "3.6.7" % Test libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % Test libraryDependencies += "com.microsoft.sqlserver" % "mssql-jdbc" % "7.2.2.jre8" % Test libraryDependencies += "org.springframework.boot" % "spring-boot-starter" % "2.3.5.RELEASE" % Test libraryDependencies += "com.typesafe" % "config" % "1.4.1" % Test Test / javaOptions += "-DpropertiesFile=./src/test/resources/application.properties"
plugins.sbt
addSbtPlugin("io.gatling" % "gatling-sbt" % "3.2.0")
Example code:
class FooSimulation extends Simulation { before { println(s"x=${System.getProperty("x")}") println(s"y=${System.getProperty("y")}") println(s"z=${System.getProperty("z")}") } setUp( scenario("Foo") .exec( foo chain builder ) .inject( foo injection ) ).protocols( foo protocol ) }
Additionally my sbt shell is running with prefix sbt:gatling, maybe this is the reason?
-
java.lang.RuntimeException: Settings logger used after project was loaded
i am using play framework 2.6 and sbt latest version I ran sbt -jvm-debug 9000 and received this following error. not sure how to solve this. (any suggestions is welcomed in order to improve question)
[Ecom OS] $ run java.lang.RuntimeException: Settings logger used after project was loaded. at scala.sys.package$.error(package.scala:27) [trace] Stack trace suppressed: run last compile:run for the full output. [error] (compile:run) Settings logger used after project was loaded. [error] Total time: 1 s, completed 6 May, 2022 2:49:17 PM [Ecom OS] $ last compile:run java.lang.RuntimeException: Settings logger used after project was loaded. at scala.sys.package$.error(package.scala:27) at sbt.LogManager$$anon$1$$anonfun$slog$1.apply(LogManager.scala:110) at sbt.LogManager$$anon$1$$anonfun$slog$1.apply(LogManager.scala:110) [error] (compile:run) Settings logger used after project was loaded.
-
ScalaPb sbt: Import "data/common/num.proto" was not found or had errors
My project structure is:
logs - data - pubs - invent.proto - common - num.proto
NOTE - The .proto files are not under
src/main/protobuf
. They're under a directory calledlogs
directly under projectIn
invent.proto
, I haveimport "data/common/num.proto";
My build.sbt is:
scalaVersion := "2.12.12" libraryDependencies += "com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf" PB.includePaths in Compile := Seq( baseDirectory.value / "logs" ) excludeFilter in PB.generate := "test-*.proto" PB.targets in Compile := Seq( scalapb.gen() -> baseDirectory.value/"src/main/scala" )
When I compile, I get the below error:
data/common/num.proto: File not found. data/pubs/invent.proto: Import "data/common/num.proto" was not found or had errors.
How can I solve this issue? I'm not trying to import external .proto files. These files are present in the repo.
- Why I get this error after run 'yarn start'?
-
Yarn start run normally but browser not open
In the terminal:
yarn start
The response is:
yarn run v1.22.18 $ react-scripts start Done in 0.15s.
Nothing happens, no browser is opened
Other projects in the same machine works fine, with the same Node version and NPM version.
-
In yarn.lock, what is the meaning of separating package names with a comma?
Check out this
yarn.lock
file example:# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 package-1@^1.0.0: version "1.0.3" resolved "https://registry.npmjs.org/package-1/-/package-1-1.0.3.tgz#a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0" package-2@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/package-2/-/package-2-2.0.1.tgz#a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0" dependencies: package-4 "^4.0.0" package-3@^3.0.0: version "3.1.9" resolved "https://registry.npmjs.org/package-3/-/package-3-3.1.9.tgz#a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0" dependencies: package-4 "^4.5.0" package-4@^4.0.0, package-4@^4.5.0: version "4.6.3" resolved "https://registry.npmjs.org/package-4/-/package-4-2.6.3.tgz#a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0"
I'm having a hard time understanding what the
package-4@^4.0.0, package-4@^4.5.0:
part means. At first, I thought the comma acted as an OR condition, but in this case, just sayingpackage-4@^4.0.0:
would be enough. I searched all around, and I didn't find any detailed explanation about theyarn.lock
file format.