HELP: I am trying to get started with purescript and react

Hi,

Trying to get started with purescript and react, when running the commands in the README it says.

spago install react-basic react-basic-dom react-basic-hooks
[error] The following packages do not exist in your package set:
[error]   - react-basic
[error]   - react-basic-dom
[error]   - react-basic-hooks`Preformatted text`

TBH everything looks very good from outside, but every time I start using purescript I hit a wall.

The dev tools are incredible hard to figure and this is coming from someone working with Scala and SBT for many years.

Anything more than “hello world” is inaccessible to newbies, is this intended ?

Thank you

Presumably you’re using the latest PureScript version right now, which is 0.14. Since it was released very recently, not all of the packages in the package set were upgraded to 0.14, so some of them were temporarily removed. That includes the packages you’re trying to install. If you go back to 0.13.8, everything should be fine. As for how to downgrade the package set version, I’m not sure how to do that, so hopefully somebody will chime in.

Obviously not, and there are many people working hard to improve the quality of the documentation and tooling surrounding PureScript. That’s why this website exists: so you can ask any questions related to PureScript.

Thanks, at least I know what that error means now, I will try to start from scratch with an older version of purescript.

1 Like

I think you can find some react examples here: https://github.com/JordanMartinez/purescript-cookbook

Here’s the issue tracking the 0.14 react upgrade, and instructions to manually override the package set to use react with 0.14 while we’re waiting for all dependency PRs to go through.

If you’re working with the 0.13.8 version of the compiler, but have the psc-0.14.0-* package set specified in your packages.dhall and want to downgrade to e.g. psc-0.13.8-20210226 (the latest 0.13.8 release listed here) I think you should be able to just replace the relevant part of the GitHub URL and delete the sha256 and everything after it:

let upstream =
-    https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210304/packages.dhall sha256:c88151fe7c05f05290224c9c1ae4a22905060424fb01071b691d3fe2e5bad4ca
+    https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20210226/packages.dhall

Then running spago install should generate the sha256 hash. I’m not sure of a less manual way, there doesn’t seem to be a spago downgrade-set command that I’m aware of.

I think you could run spago install --tag psc-0.13.8-20210226

2 Likes

I think you meant spago upgrade-set --tag psc-0.13.8-20210226?

3 Likes