0

After setting up environment for cohort 3 of the pioneers program, running the plutus-playground-client crashes on my Intel Mac (Big Sur).

I've been able to successfully set up Nix and all the code repos as described in course materials and from other sources (like the list provided in Lessons Learned setting up plutus-playground - feedback welcome). When I run the plutus-playground-server it seems to run with the following output (although I'm a little bothered about the env var warnings):

[nix-shell:~/Documents/__projects/cardano/code/plutus-apps/plutus-playground-client]$ plutus-playground-server
plutus-playground-server: for development use only
[Info] Running: (Nothing,Webserver {_port = 8080, _maxInterpretationTime = 80s})
Initializing Context
Initializing Context
Warning: GITHUB_CLIENT_ID not set
Warning: GITHUB_CLIENT_SECRET not set
Warning: JWT_SIGNATURE not set
Interpreter ready

But when I run npm start from within nix-shell, the client crashes

as seen here

[nix-shell:~/Documents/__projects/cardano/code/plutus-apps/plutus-playground-client]$ npm start

> [email protected] start /Users/stevenmason/Documents/__projects/cardano/code/plutus-apps/plutus-playground-client
> plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev

[Info] Running: (Nothing,PSGenerator {_outputDir = "generated"})
The following purescript packages are needed by the generated code:

  - plutus-playground-client
  - purescript-argonaut-codecs
  - purescript-either
  - purescript-enums
  - purescript-lists
  - purescript-maybe
  - purescript-newtype
  - purescript-ordered-collections
  - purescript-prelude
  - purescript-profunctor-lenses
  - purescript-tuples
  - web-common

Successfully created your PureScript modules!

Successfully created your servant API purescript functions!
Please make sure you have purescript-servant-support and purescript-bridge-json-helpers installed

plutus-playground-server: user error (Error evaluating simulation: InterpreterError (CompilationErrors [CompilationError {filename = "\n/private/tmp/web-ghc-work-6c4731ae725049b4/Main.hs", row = 2, column = 1, text = [" error:","    Could not find module \8216Playground.Contract\8217","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","2 | import Playground.Contract","  | ^^^^^^^^^^^^^^^^^^^^^^^^^^"]},CompilationError {filename = "/private/tmp/web-ghc-work-6c4731ae725049b4/Main.hs", row = 3, column = 1, text = [" error:","    Could not find module \8216Plutus.Contract\8217","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","3 | import Plutus.Contract","  | ^^^^^^^^^^^^^^^^^^^^^^"]},CompilationError {filename = "/private/tmp/web-ghc-work-6c4731ae725049b4/Main.hs", row = 4, column = 1, text = [" error:","    Could not find module \8216PlutusTx.Prelude\8217","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","4 | import PlutusTx.Prelude","  | ^^^^^^^^^^^^^^^^^^^^^^^"]}]))
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/stevenmason/.npm/_logs/2022-01-13T19_43_24_861Z-debug.log

The contents of the log is

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/bin/node',
1 verbose cli   '/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/bin/npm',
1 verbose cli   'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/stevenmason/Documents/__projects/cardano/code/plutus-apps/plutus-playground-client/node_modules/.bin:/nix/store/d9000clw08vx5ls6rjzshr6w1dmp2hkw-bash-interactive-5.1-p12/bin:/nix/store/r3cw1f1b49440awbyk870vhn4gs4pvq9-ghc-shell-for-packages-ghc-8.10.4.20210212-env/bin:/nix/store/jx31ah14p6pf488i7wwd88y2izmxi0wj-clang-wrapper-7.1.0/bin:/nix/store/xhijdap7ln3nw867cq6m3knshww9f2rn-clang-7.1.0/bin:/nix/store/crjmgrws5w2pjhm5k887m93rrkcf36hb-coreutils-8.32/bin:/nix/store/4j3q5kmmdwkgppn6g8hna8wg6a4zrvxd-cctools-binutils-darwin-wrapper-949.0.1/bin:/nix/store/falx4gakl6k1q64aqr4f8mvy8vfqcqaq-cctools-binutils-darwin-949.0.1/bin:/nix/store/krhkk38bd42357y2z158l3r09k2mdj51-pkg-config-wrapper-0.29.2/bin:/nix/store/51pqfp0f7h03jsvh2a4fyimbp2hkzwgp-alex-exe-alex-3.2.6/bin:/nix/store/4klljapwi8g41xv815af7gfd7sv4rjws-happy-exe-happy-1.20.0/bin:/nix/store/mjs3g246lbdp413axx5j10jxpzkkwlbw-doctest-exe-doctest-0.18.1/bin:/nix/store/vy0swc77m6nz61awgsipg03s8mszif8i-editorconfig-core-c-0.12.1/bin:/nix/store/qw2j33zylr4gz77rbrnrdqg56sqdlw9x-ghcid-0.8.7-bin/bin:/nix/store/hmmba0bqn54xw13w8hm2rcdy504lr9js-jq-1.6-bin/bin:/nix/store/d6f5yc829p8nmaccs67wkjs5bwqa1770-nix-flakes-alias/bin:/nix/store/ds6m4l0xhv850pqds6y6cxipqrf4r64a-nixpkgs-fmt-1.1.0/bin:/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/bin:/nix/store/8wyjxi4phrhrvmjsvbcdxjff88hmvq21-shellcheck-0.7.2-bin/bin:/nix/store/3gzgnpg6nf6qa120s7gz5xpb6f0pf80z-sqlite-3.35.5-bin/bin:/nix/store/j7f4sgvfcnvz59ay3jmz5212xgb5pd6v-stack-2.7.3/bin:/nix/store/kkx3hcr3px00wpmadnjj3cldqnsd9vlc-python3.9-yq-2.12.2/bin:/nix/store/ad19ya4siaxhz63w0m8xh97067iahks0-python3-3.9.6/bin:/nix/store/kzbbn2k96mgjrk8rg152073af51hj2sh-python3.9-argcomplete-1.12.3/bin:/nix/store/05zmnmy39zp5j3prwfhiy84zv98c7v1d-python3.9-chardet-4.0.0/bin:/nix/store/3j6ljn1bc604k8v5ri16q8bz5l8nl7za-python2.7-setuptools-44.0.0/bin:/nix/store/8vdbhdsmlhvll54pwmkkrhvpmcmh7vz8-python-2.7.18/bin:/nix/store/mvyh8afbd47kfpqjsgpnbv4ajb670kca-z3-4.8.10/bin:/nix/store/7c096h8vzvl96ni4wklf26rzf42p4pyq-cabal-install-exe-cabal-3.6.2.0/bin:/nix/store/qxzkl3pvmj1agri8a4k6awd4gsd61in2-cardano-cli-exe-cardano-cli-1.32.1/bin:/nix/store/8mawdcyar3ywar6c16p258lfb25qd3qn-cardano-node-exe-cardano-node-1.32.1/bin:/nix/store/wh73413j6pylms06mza4462xzlpbli3x-cardano-wallet-exe-cardano-wallet-2021.12.15/bin:/nix/store/rwb735hnzskimykgcnw5i42p9hyd0a2k-cardano-repo-tool-exe-cardano-repo-tool-0.1.0.0/bin:/nix/store/hnj1vx7z3idysp0ykyq9vf935ak3cgha-fix-png-optimization/bin:/nix/store/fraynam5fa5q6q7flf3alpcp6hfxipp5-fix-purty/bin:/nix/store/aa2xihy0bxkkgf3j78sc2crb61y57v6h-fix-stylish-haskell/bin:/nix/store/5fhjibn8vnkmbaivzdw62yg34qbykw3m-haskell-language-server-exe-haskell-language-server-1.3.0.0/bin:/nix/store/7cbz32gyp6l5m0i97zqam4lzdzgiv2m8-haskell-language-server-wrapper/bin:/nix/store/zwkmxz2bgyzvhyf0xxhnwnvg885lnyzh-hie-bios-exe-hie-bios-0.7.6/bin:/nix/store/2hh7ba4f243q65i9pk0xli6g55k384z9-hlint-exe-hlint-3.2.7/bin:/nix/store/1hdj8zn64h1q10g9kw1v75s826lj2ydz-pab-nami-demo-generate-purs/bin:/nix/store/zrqbg3v8rynqzzhjcd86zb9yyin3cjc8-pab-nami-demo-server/bin:/nix/store/2nr8xfy3zqdgxfmxlc3r48gijfdwbnrf-plutus-playground-generate-purs/bin:/nix/store/601kdlvidgan842yfklrmvpbz6a5xkf7-plutus-playground-server/bin:/nix/store/m8ixb6svc1l8fzxlh67c4qm96vbb6d1i-node_psa-0.8.2/bin:/nix/store/2d664y3zphch8qg72cg19hgprxrhcn9l-node_purescript-language-server-0.15.8/bin:/nix/store/rnvv5rz6hi23r0vhply8dmp2wjdmc7mx-purescript-v0.14.5/bin:/nix/store/2nhbwz6k00njy334ad3d7k9wf0kgjfj6-purty-7.0.0/bin:/nix/store/qvgi2dmj9h91hiasmpmd9bar9qzv9l4y-spago-0.20.3/bin:/nix/store/wacwgza57b0f3qvbrcaw7sbvxyvn46wi-spago2nix/bin:/nix/store/b88jr6n685vp762f5y81kq50saw0p9jm-stylish-haskell-exe-stylish-haskell-0.13.0.0/bin:/nix/store/isp8r9zcpgl8283vplckpidlc6g6pxmj-updateMaterialized/bin:/nix/store/ry116681l3qpfvjj0wp4alfabp2fnkk5-update-client-deps/bin:/nix/store/hrxaiplqwgf0m6i27ffgl0hza1hkvri5-build-and-serve-docs/bin:/nix/store/a1w9dirw10sk22nk8f9yykfxdm428lxx-python3-3.9.6-env/bin:/nix/store/fci25bpkavmg481ws49qdjvv9k4vmm6y-ncurses-6.2/bin:/nix/store/qgygs5g9l0zxhs8fzjjqpmmlzps1hlrd-libiconv-50/bin:/nix/store/crjmgrws5w2pjhm5k887m93rrkcf36hb-coreutils-8.32/bin:/nix/store/2fzds9cqx148i1lf84sc9i0982bv9rbx-findutils-4.8.0/bin:/nix/store/adigdkh0pibb4afqf5q2sv3503ln0iyb-diffutils-3.7/bin:/nix/store/z6ih791dzyjvdqm8gl5glz065kk8zh7p-gnused-4.8/bin:/nix/store/lr3fvwhvd8zpmjbibd3h02qdx85mxrv4-gnugrep-3.6/bin:/nix/store/phq0s0i1vhlvs7y77gyygnyd1zm76mlh-gawk-5.1.0/bin:/nix/store/q7wxq69v35d0bxiqrycldz00wg9kxqzd-gnutar-1.34/bin:/nix/store/3n9fvf4ybdwizym6cwnjf6f57p7mvrab-gzip-1.10/bin:/nix/store/j998frnsa1hxkfbysq0bkw6hjfrd928v-bzip2-1.0.6.0.2-bin/bin:/nix/store/aqrq990va9j1v6gvrgxksr5av9vpcxz3-gnumake-4.3/bin:/nix/store/715y5lnw12vdcc3hh9sc9vbkdi6c83x6-bash-4.4-p23/bin:/nix/store/cqadarnj29fpv1vm8bzbh6dpb8aaxzjz-patch-2.7.6/bin:/nix/store/00vcq1i9x1dwwn21dqkagybcxa1lcnwi-xz-5.2.5-bin/bin:/Users/stevenmason/.yarn/bin:/Users/stevenmason/.config/yarn/global/node_modules/.bin:/Users/stevenmason/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/Users/stevenmason/.yarn/bin:/Users/stevenmason/.config/yarn/global/node_modules/.bin:/Users/stevenmason/.pyenv/shims:/Users/stevenmason/Documents/__projects/temp_gcloud/google-cloud-sdk/bin:/Users/stevenmason/.nvm/versions/node/v10.16.0/bin:/Users/stevenmason/.rvm/gems/ruby-2.5.5/bin:/Users/stevenmason/.rvm/gems/ruby-2.5.5@global/bin:/Users/stevenmason/.rvm/rubies/ruby-2.5.5/bin:/usr/local/opt/python/libexec/bin:/usr/local/sbin:/Users/stevenmason/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/local/git/bin:/Users/stevenmason/.rvm/bin:/Library/android-sdk-macosx/tools:/Library/android-sdk-macosx/platform-tools:/Applications/Postgres.app/Contents/Versions/9.4/bin:/Library/android-sdk-macos/tools/emulator:/Library/android-sdk-macos/tools/tools:/Library/android-sdk-macos/tools/tools/bin:/Library/android-sdk-macos/tools/platform-tools:/Library/android-sdk-macos/tools/emulator:/Library/android-sdk-macos/tools/tools:/Library/android-sdk-macos/tools/tools/bin:/Library/android-sdk-macos/tools/platform-tools:/nix/store/lx1v7fr9487halyyzk42a0n9yy285vcy-python3.9-pre-commit-2.13.0/bin
9 verbose lifecycle [email protected]~start: CWD: /Users/stevenmason/Documents/__projects/cardano/code/plutus-apps/plutus-playground-client
10 silly lifecycle [email protected]~start: Args: [
10 silly lifecycle   '-c',
10 silly lifecycle   'plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev'
10 silly lifecycle ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:400:28)
13 verbose stack     at ChildProcess.<anonymous> (/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:400:28)
13 verbose stack     at maybeClose (internal/child_process.js:1055:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/stevenmason/Documents/__projects/cardano/code/plutus-apps/plutus-playground-client
16 verbose Darwin 20.6.0
17 verbose argv "/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/bin/node" "/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/bin/npm" "start"
18 verbose node v14.17.4
19 verbose npm  v6.14.14
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

The error in this log references /nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4 which I don't see in /nix/store. I assume this is likely the problem, but I'm new to nix and don't know how to fix this. I see lots of other 'packages' in the store but not this one. Can someone please tell me what I can try to get this working.

BTW, this problem seems similar to Error Starting plutus-playground-client (posted Sep 2021), but no one has provided and answer to that question

Thanks

4
  • I've been trying to reproduce your issue, but wasn't able to. Could you please provide where you got the git clone command from (for reference) and provide your current git revision? You can obtain that from the plutus-apps folder with plutus-apps $ git rev-parse HEAD.
    – angerman
    Commented Jan 14, 2022 at 4:23
  • Also, to get the contract to properly compile on the server end, I had to include the same command as was mentioned to start the client: GC_DONT_GC=1 plutus-playground-server
    – user6076
    Commented Jan 17, 2022 at 2:58
  • could only mark one answer as correct, but this was need to to get everything working. Commented Jan 17, 2022 at 21:06
  • It did get this working, but for completeness, I got the git clone from the Github repo (copy to clipboard). And git rev-parse HEAD gave me 41149926c108c71831cfe8d244c83b0ee4bf5c8a Commented Jan 17, 2022 at 21:14

1 Answer 1

2

To make npm work, you can try GC_DONT_GC=1 npm start.

However; I found the way the playground starts using nix-build in the script to start the server and running npm to get the frontend fickle and convoluted. My coworker Shay and I worked on https://github.com/input-output-hk/plutus-pioneers. This is still pretty raw and hopefully the logic will eventually be added into plutus-apps repository, but here's a quick run-down of how to use it:

Make sure you have nix 2.5 (or some 2.4pre's will work as well, but do yourself a favor and upgrade to nix 2.5).

In nix.conf (file where binary cache is setup) add:

experimental-features = nix-command flakes

Then just run: nix develop github:input-output-hk/plutus-pioneers

When that completes run start

At that point you'll have frontend and backend playground running and accessible in browser with self-signed certificate at https://localhost:8009/. You can also get all the plutus docs at https://localhost:8009/doc.

cardano-cli is in the PATH and can find the node socket by default. To validate that you can run cardano-cli query tip --testnet-magic 1097911063

To shut services down when you're done, just run stop. If you run into any bugs using, please file an issue on the GH tracker.

3
  • Thanks for your suggestion. Adding the GC_DONT_GC=1 worked for me. Commented Jan 17, 2022 at 21:05
  • Curious about your other advice though. I have nix 2.5, but wondering where do I run the nix develop github:input-output-hk/plutus-pioneers from - what directory? And also what is the context for using this? Is this an alternative/preferred way that insiders use to start up the playground? Also don't have cardano-cli. I'll have to get it (and build it I assume) Commented Jan 17, 2022 at 21:08
  • This is my teams effort to improve the UX for all pioneers. I hope to get it upstreamed into plutus-apps but we're still working on tweaking it at the moment. Biggest drawback right now is on a mac it's building a bunch of stuff not in the binary cache. Commented Jan 19, 2022 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.