prismicio / slice-machine

A series of tools for developing and deploying website sections with Prismic
https://prismic.io/docs
Apache License 2.0
287 stars 53 forks source link

Can't install #1045

Closed sntiagomoreno closed 1 year ago

sntiagomoreno commented 1 year ago

Versions

Reproduction

Running npx @slicemachine/init will output

Updated Slice Machine configuration
   βœ– Loading adapter...
    β†’ Could not resolve plugin `@slicemachine/adapter-next`. Check tha…
Error: Could not resolve plugin `@slicemachine/adapter-next`. Check that it has been installed.
Additional Details I've tried installing the dependencies manually and still happens ``` { "name": "wake", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@prismicio/client": "^7.1.0", "@prismicio/next": "^1.3.3", "@prismicio/react": "^2.7.1", "@types/node": "20.4.1", "@types/react": "18.2.14", "@types/react-dom": "18.2.6", "eslint": "8.44.0", "eslint-config-next": "13.4.9", "next": "13.4.9", "react": "18.2.0", "react-dom": "18.2.0", "typescript": "5.1.6" }, "devDependencies": { "@slicemachine/adapter-next": "^0.3.3", "slice-machine-ui": "^1.5.0" } } ```

Steps to reproduce

Run npx @slicemachine/init in a fresh Next.js install.

What is expected?

To be able to install prismic.

What is actually happening?

Not installing prismic. Unable to use prismic.

zrisher commented 1 year ago

Same issue with the Nuxt adapter.

xrutayisire commented 1 year ago

Hello, thank you for the bug report.

It seems you are running "npx @slicemachine/init" on a project that already have a "slicemachine.config.json" file, correct? What is the exact process you followed? Starting from "npx create-next-app@latest" I guess, and after?

In order to run "npx @slicemachine/init" you should directly launch it in a Next.js project without manually creating any Prismic related file, it will be done for you πŸ™‚

If you remove "slicemachine.config.json" or any other related Prismic files/folders you created, the init should work, just tested it.

zrisher commented 1 year ago

I encounter the same error message even after removing the generated slicemachine.config.json (didn't see any other Prismic-related files).

Node v16.19.0
NPM v9.8.0
Nuxt v3.6.2

Note that npm i @slicemachine/adapter-next succeeds, but the above command still returns the same error afterwards. I can see the installed package in node_modules.

xrutayisire commented 1 year ago

If it's a simple app without any private files, could you provide us with a GitHub repository so that we can reproduce the issue on our end? πŸ™‚

mdeclercq commented 1 year ago

Hello,

We reproduced the issue and are preparing a fix that should be deployed today. We'll let you know once it is fixed.

xrutayisire commented 1 year ago

We just released a new version of Slice Machine (1.5.1) and the adapters (0.3.4) that should fix your problem πŸš€.

Please try and tell us, thank you πŸ™‚

sntiagomoreno commented 1 year ago

Works perfectly now, thanks!