jsdom in scalajs tutorial throws error on run with `?.` - scala

I am working on the Scala JS Tutorial located at: https://www.scala-js.org/doc/tutorial/basic/index.html which also links to the Repo: https://github.com/scala-js/scalajs-tutorial
So far I get through Step 5. The sample works well when you do:
sbt
~fastLinkJS
So when I run the run command that is where I have problems ( Starting Step 6 ). Node if you are using the Github Repo, make sure you update build.properties SBT version to 1.7.1 ( thats the version I have ).
When I then use the RUN command from within SBT, it will give the error I run into. So i can confirm it is reproducible.
I was not sure if it is also related to my machine. My statics are below:
uname -a:
Darwin HQSML-1689569 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 x86_64
node --version:
v12.4.0
sbt -version:
sbt version in this project: 1.7.1
sbt script version: 1.7.1
scala -version:
Scala code runner version 3.1.3 -- Copyright 2002-2022, LAMP/EPFL
Is this a current bug? Is this a ScalaJS thing? I was curious if it has lagged behind in comparison to javascript or something and it just fails to understand what the ?. statement means. Nothing is wrong with the jsdom module from what I can tell when looking at the JS itself, so i am thinking it is related to the Interpreter or something?

Related

sbt runs on command line but not VS code

So I've been trying to run scala on vs code for nearly a week now with no luck. We have been recommended to use sbt to run our programs.
I'm running java version "1.8.0_301" on my build environment.
when running the sbt command on vs code I get project loading failed with this error:
[error] java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI
What's weird is that I can run sbt on my command line with no problems!
I'm pretty new to this so any help would be greatly appreciated.
https://imgur.com/l2qzS01 (link to the vs code window after failed loading and scala running on terminal)
cheers!
This is an error that occurs with outdated sbt versions. Upgrade to the latest sbt version and you should be fine.
Unfortunately I don't recall exactly when this was fixed.

Scala: packages cannot be represented as URI

I have openjdk, scala and sbt, all installed via brew. I'm trying to
get setup to work on the scala track on exercism. I'm having no
troubles with Java or anything that uses the JVM like clojure, but
when I try to test my installation of scala by running the test for
the exercism hello example:
$ sbt test
I get a bunch of errors that seem to start with this:
java.io.IOError: java.lang.RuntimeException:
/packages cannot be represented as URI
My installed versions are as follows:
$ java --version
openjdk 13.0.1 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.1+9, mixed mode, sharing)
$ scala -version
Scala code runner version 2.13.1 --
$ sbt --version
sbt version in this project: 1.3.8
sbt script version: 1.3.8
I've looked and seen this error in a few questions but not seen a way to fix it.
I solved the issue by installing a java version of 1.8 and set JAVA_HOME towards this version.
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home"
I've got the same issue on IntelliJ IDEA and solved it with
Settings > Build, Exec... > Build Tools > sbt > JRE > set to 1.8.
JAVA_HOME has not resolve it in my case
In my case, in Intellij IDEA, I had JAVA_HOME as well as sbt JRE from the previous answer set to 1.8, but I completely forgot about the Project SDK, which was set to an incompatible version.
Ctrl + Alt + Shift + S > Project Settings > Project > Project SDK
Setting this to 1.8 as well as language levels of modules to 8 fixed my issues.
Intellij :
open Settings -> Build, Execution, Deployment -> Scala Compiler -> Scala Compile Server, then change the JDK to the one your project used. This solution solved my problem.
IntelliJ:
Go to File -> Settings -> Build, Execution, Deployment -> Build Tools -> sbt
Make sure Use sbt shell for build is checked
I found this S/O answer solves my issue:
This is a Scala compiler bug. Please upgrade to the latest Scala point release, 2.12.16.

Fixing scala compiler and library in IntelliJ 13

I have intellij 13 ultimate.
I had scala 2.10.3 installed, and recently upgraded to 2.11 using homebrew.
When I open a sbt project, it may have a different scala version and if it does then it starts to download etc.
Will IntelliJ automatically use the correct compiler for a sbt project once it finishes downloading everything?
I currently have these errors which I'm not sure how to fix:

what is the way to install the basic4android

I installed the jre7 and jdk1.7 and android sdk and avd manager perfectly my emulator is working properly but when i run the program which i wrote it is showing
Compiling code. 0.11
Compiling layouts code. 0.02
Generating R file. 0.00
Compiling generated Java code. Error
javac 1.7.0_17
javac: file not found: src\com\empire\designerscripts\*.java
Usage: javac <options> <source files>
use -help for a list of possible options
i newly formatted my system installed these
I am using basic4android in my laptop without any problem but in case of my desktop system it is showing the above error...
I have understood from Erel that this is fixed with Basic4Android v2.50 or above. One can also instead install the latest Java 6 version and use it for compilation.
The use of Java 6 was successful in my case.
I think that the problem is with the jdk that you are running. Try with jdk1.6.0_25. I use this one and never update this version because the version 7 have some issues with security.

Using Scons to build mongo-nonx86 on an arm based Synology NAS

I have a Synology DS212j NAS (cpu Feroceon 88FR131 rev 1 (v5l)) with the optware ipkg installed. I am trying to build mongo-nonx86 on it.
"scons all" gives me the following messages:
scons: Reading SConscript files ...
scons version: 2.0.1
python version: 2 5 6 'final' 0
Checking whether the C++ compiler worksyes
Checking for C library stdc++... no
can't find stdc++ library which is needed
I have the stdc++ library installed, I also have ssl installed. My underlying question is how can I get scons to tell me more about what is really missing, where it is looking, how it is looking etc. I have so far found no options which generate any more useful diagnostic output?
Obviously a ready-made solution for getting mongodb working on this great little box would be even more welcome :-)
Well even if you do have it installed, it doesn't seem to think so, here is what I would try to do, install libssl-dev, then try to install the dev package for libstdc++, which is: libstdc++-dev.
Then see if you can compile it.