Code Monkey home page Code Monkey logo

Comments (14)

ahjohannessen avatar ahjohannessen commented on May 12, 2024

I use scalapb 0.4.14 and "com.github.os72" % "protoc-jar" % "2.x.5" using "-v261". It seems to work without problems having

syntax = "proto2";
import "scalapb/scalapb.proto";
...

at the beginning of my proto files.

from scalapb.

thesamet avatar thesamet commented on May 12, 2024

@crispywalrus Thanks for reporting. Are you on protoc 2.6.1 or an earlier version?

We can solve it by providing a second copy of scalapb.proto without that line so it can work with older protoc's. In the mean time you can work around it by modifying your own copy of scalapb.proto.

from scalapb.

thesamet avatar thesamet commented on May 12, 2024

Closing due to inactivity. I believe this should work on >=2.6.1

from scalapb.

onsails avatar onsails commented on May 12, 2024

@thesamet I am using protoc 2.6.1 and getting an error

Import "scalapb/scalapb.proto" was not found or had errors.

I suppose it's related to this issue.

from scalapb.

onsails avatar onsails commented on May 12, 2024

nvm, I didn't add scalapb-runtime

from scalapb.

niiamon avatar niiamon commented on May 12, 2024

@prettynatty how did you add scalapb-runtime?

from scalapb.

thesamet avatar thesamet commented on May 12, 2024

@niiamon See "Adding scalapb.proto to your project" at http://trueaccord.github.io/ScalaPB/customizations.html

from scalapb.

niiamon avatar niiamon commented on May 12, 2024

@thesamet thanks but I already have that in the project but it's still not working.

@prettynatty I'm actually using your actor-server but I am simply unable to get it to compile due to the protobufs error.

These are some of the issues that complain when I attempt a build:

Error: Import "scalapb/scalapb.proto" was not found or had errors.
Error: Import "sequence.proto" was not found or had errors.

Any ideas how I can get over this?

from scalapb.

thesamet avatar thesamet commented on May 12, 2024

@niiamon Will you be able to reproduce this issue on a minimal project and post it on github so we can help debug?

from scalapb.

niiamon avatar niiamon commented on May 12, 2024

@thesamet on it. I will revert here as soon as I have something.

from scalapb.

niiamon avatar niiamon commented on May 12, 2024

@thesamet Please see this: https://github.com/niiamon/scalapb-test. I have Scala PB added to the project and I have a small proto file in there.

I am still relatively new to Scala and Protocol Buffers as well so any comments are welcome.

from scalapb.

thesamet avatar thesamet commented on May 12, 2024

@niiamon , your build.sbt was adding sbt-scalapb instead of scalapb-runtime to the library dependencies. Another unrelated issue that prevented it from compiling was a reference to a configuration named testerpackage, I renamed it to test so the example can fully run.

So the full libraryDependencies in your case should be:

libraryDependencies ++= {
  val akkaV       = "2.3.12"
  val akkaStreamV = "1.0"
  val scalaTestV  = "2.2.5"
  Seq(
    "com.typesafe.akka" %% "akka-actor"                           % akkaV,
    "com.typesafe.akka" %% "akka-stream-experimental"             % akkaStreamV,
    "com.typesafe.akka" %% "akka-http-core-experimental"          % akkaStreamV,
    "com.typesafe.akka" %% "akka-http-experimental"               % akkaStreamV,
    "com.typesafe.akka" %% "akka-http-spray-json-experimental"    % akkaStreamV,
    "com.typesafe.akka" %% "akka-http-testkit-experimental"       % akkaStreamV,
    "org.scalatest"     %% "scalatest"                            % scalaTestV % "test",
    "com.trueaccord.scalapb" %% "scalapb-runtime"                 % "0.5.9" % PB.protobufConfig
  )
}

from scalapb.

niiamon avatar niiamon commented on May 12, 2024

@thesamet so I've made those changes here as well. No such luck. I still get the same import was not found problem.

from scalapb.

thesamet avatar thesamet commented on May 12, 2024

Works completely fine here when I start sbt and type compile. Have you reloaded sbt after making the change (type 'reload' in an existing sbt session, or just exit sbt and start it again)? If the problem persists after an sbt restart, let's continue debugging it at Stackoverflow (please @thesamet there)

from scalapb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.