Github Codespaces for Development

Describe your question/issue in detail

I'm trying to make use of GitHub Codespaces to work on NextJS/Prismic projects. I can get Slice Machine up and running via Codespaces, however, when I log into Prismic via slice machine, the following error occurs:


It looks like your CLI is unreachable, please refresh the page.
The URL for this login is: and is coming from

When running prismic login via CLI in codespace, the following error results:

➜ /workspaces/prismic-reponame-here(main) $ prismic login
Prismic: Press any key to open up the browser to login or q to exit: 
Opening browser to
Prismic: Logging in... done
      const err = new ErrnoException(exitCode, syscall);

Error: spawn xdg-open ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn xdg-open',
  path: 'xdg-open',
  spawnargs: [ '' ]

Are there steps we can take to make this work with codespaces? Perhaps adjusting the login URL attributes in some way?

Steps to reproduce

  1. Go to a GH repo that you have using Next and Prismic.
  2. Click the green code button.
  3. Click green Create codespace on main button
  4. Installation of dependencies happens automatically via NPM (cancel and use your preferred package manager if necessary)
  5. Run you dev script
  6. Launch your slicemachine (codespaces will do this in a new tab with forwarding handled)
  7. In slicemachine, click log into prismic

Hi Neil, I'm excited to hear you are using Codespaces for development!

We don't officially support cloud dev environments today since they behave slightly differently from your local environment. In this case, the issue is likely that logging into Prismic currently only sends the authentication token back to localhost, which is probably not connected to Codespaces. Controlling where it gets sent via URL parameters could be a security issue since it means your token could be sent anywhere.

We also try to smartly open your browser to open the login screen, which may be causing that xdg_open error you see. That command may not function properly in cloud environments.

Of course, this is something should be able to make work. We don't have any immediate plans to work on this topic, but I'll make sure the team is aware of this for the future.

1 Like