slice-machine icon indicating copy to clipboard operation
slice-machine copied to clipboard

Browser does not open

Open Aloso opened this issue 1 year ago • 8 comments

When running npx @slicemachine/init@latest, it says it opened the browser to login, but no browser tab was opened.

This is preventing me from trying out Prismic.

Versions

  • slice-machine-init: 2.9.17
  • node: v21.7.3

Steps to reproduce

Create a repository and follow the setup instructions:

npx @slicemachine/init@latest --repository **** --starter sveltekit-starter-prismic-minimal

When it asks you to press any key, press any key.

What is expected?

Browser tab opens to login

What is actually happening?

Nothing.

Environment

I use Manjaro Linux with KDE Plasma. I have Firefox and Chromium installed:

> screenfetch

 ██████████████████  ████████     ludwig@ludwig-se
 ██████████████████  ████████     OS: Manjaro 24.0.0 Wynsdey
 ██████████████████  ████████     Kernel: x86_64 Linux 6.9.0-1-MANJARO
 ██████████████████  ████████     Uptime: 24m
 ████████            ████████     Packages: 1489
 ████████  ████████  ████████     Shell: fish 3.7.1
 ████████  ████████  ████████     Resolution: 3840x2160
 ████████  ████████  ████████     DE: KDE
 ████████  ████████  ████████     WM: KWin
 ████████  ████████  ████████     GTK Theme: Breeze-Dark [GTK2], Breeze [GTK3]
 ████████  ████████  ████████     Icon Theme: breeze
 ████████  ████████  ████████     Disk: 62G / 922G (7%)
 ████████  ████████  ████████     CPU: AMD Ryzen 7 7840HS w/ Radeon 780M Graphics @ 16x 4.35GHz
 ████████  ████████  ████████     GPU: AMD Radeon Graphics (radeonsi, gfx1103_r1, LLVM 17.0.6, DRM 3.57, 6.9.0-1-MANJARO)
                                  RAM: 5901877248-

> type firefox
firefox is /usr/bin/firefox
> type chromium 
chromium is /usr/bin/chromium

Aloso avatar May 21 '24 16:05 Aloso

Hi, is your port 9999 used already? We have this problem, when the port 9999 is used, nothing will be displayed.

No worries, in any case, you can run manually npm run dev inside the starter you cloned. It will run slice-machine and your project.

xrutayisire avatar May 21 '24 16:05 xrutayisire

@xrutayisire thanks for your response. The port 9999 is not in use.

I tried running npm run dev even though slice-machine-init wasn't completed. I got a 500 error, with these logs in the terminal:

[vite:dev] ParsingError: [Link resolver error] Unknown type
[vite:dev] Declared type: page
[vite:dev] Expected one of:

Also, on the prismic website I was not able to proceed:

grafik

Aloso avatar May 21 '24 16:05 Aloso

I misunderstood what you meant. Cloning the sveltekit-starter-prismic-minimal git repo and starting it does work, but it uses the wrong prismic repository. I want to use the repository I created.

Aloso avatar May 21 '24 17:05 Aloso

I managed to get the slice machine to work by modifying slicemachine.config.json like this:

  • set repositoryName to the name of the repository I created
  • set libraries to []

However, the website still doesn't let me proceed:

It looks like you haven't launched your starter yet.

Aloso avatar May 21 '24 18:05 Aloso

Sorry I misunderstood your issue at first. I misread and thought that at the end of the init SliceMachine couldn't run.

So yes you need to login. Can you try on another terminal? When pressing a key it should open, you're right.

xrutayisire avatar May 21 '24 21:05 xrutayisire

We discussed internally and we're planning to work on a fix by providing a backup link in the cli for these cases.

comeprismic avatar May 22 '24 07:05 comeprismic

Thanks!

I got it working on a different machine (Windows), but a fix would still be useful for anyone else running into the problem.

Can you try on another terminal?

It didn't work in the VS Code terminal, kitty, or Konsole.

Aloso avatar May 22 '24 09:05 Aloso

In case anyone else runs into this and doesn't have a Windows machine to try it on.

Follow the manual install steps here: https://prismic.io/docs/technical-reference/slice-machine-ui#manual-install

After you've gotten slicemachine to run, you may need to re-run the initial npx @slicemachine/init@latest --repository **** to get it to regenerate the prismicio.js file.

Edit: Forgot to mention. I had to run slicemachine and then click the Login button from the web ui

Christopotamus avatar Jun 10 '24 18:06 Christopotamus

Hey @Aloso, we improved this step a bit. Now, if for some reason a new tab is not opened, you have a backup URL in your terminal that can be opened manually to continue with the login process.

jomifepe avatar Aug 06 '24 09:08 jomifepe