user4833870
user4833870

Reputation:

Unable to import upickle with Scalajs-react shared dependencies

i have a small problem. I am trying to use upickle lib. i have included it in my sharedDependencies as "com.lihaoyi" %%% "upickle" % "0.3.6". For some reason i am able to import upickle in my server project but it is still not available in my client project. I am trying to understand what is it i am doing wrong. I am following scala-react-spa tutorial here

Upvotes: 2

Views: 502

Answers (2)

user4833870
user4833870

Reputation:

Forgot to answer this question. This is a problem related to indexing intellij-idea. Many a times idea just fail to index properly or fails to import sbt project. So two options that can possibly works is to go to file > invalidate cache and restart or import the project again as mention here. Sorry for chipping in late for this one.

Edit 1

Here is more details from the above link to add more description to the answer

On the right-hand side of your IntelliJ window, you will see a list of vertical tabs, open the SBT tab.
Select the module that's causing trouble, right click on it, select "Detach external project"
Try to import the module again.

Upvotes: 1

Oleg Rudenko
Oleg Rudenko

Reputation: 698

Please take a look at example build.sbt with upickle. You don't need upickle in shared project. Instead you need it in server as

"com.lihaoyi" %% "upickle" % <latestVersion>

and in client as

"com.lihaoyi" %%% "upickle" % <latestVersion>

Make sure you used 2 percent signs in server and 3 in client.

Upvotes: 0

Related Questions