Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js 15 Visual Editor not working #1323

Open
1 task done
szabolcsveer opened this issue Jan 20, 2025 · 2 comments
Open
1 task done

Next.js 15 Visual Editor not working #1323

szabolcsveer opened this issue Jan 20, 2025 · 2 comments
Labels
needs-reproduction [Contribution] The issue requires minimal reproduction.

Comments

@szabolcsveer
Copy link

szabolcsveer commented Jan 20, 2025

Describe the issue you're facing

I am having an issue with the Visual Editor currently, trying to use the app router in Nextjs 15,
as far as I understood from your docs, there is no need for any special setup for the Visual Editor to make it work.

No matter what I do I get this screen

Image

My current setup is also super simple:

storyblok.ts

`import SimpleText from '@/components/SimpleText';
import TextSection from '@/components/TextSection';
import { apiPlugin, storyblokInit } from '@storyblok/react/rsc';
import Page from '../components/Page';

export const getStoryblokApi = storyblokInit({
accessToken: process.env.STORYBLOK_ACCESS_TOKEN,
use: [apiPlugin],
apiOptions: {
headers: 'Content-Security-Policy: frame-ancestors',
cache: {
clear: 'auto',
type: 'memory',
},
},
bridge: true,
components: {
page: Page,
'text-section': TextSection,
'simple-text': SimpleText,
},
});`

page.tsx --- in app root

`import { getStoryblokApi } from '@/lib/storyblok';
import { ISbStoriesParams, StoryblokClient } from '@storyblok/react';
import { StoryblokStory } from '@storyblok/react/rsc';

export default async function Home() {
const { data } = await fetchData();
return (


ROOT PAGE




);
}

async function fetchData() {
let sbParams: ISbStoriesParams = { version: 'draft' };

const storyblokApi: StoryblokClient = getStoryblokApi();
return storyblokApi?.get(cdn/stories/nietzsche, sbParams);
}`

What am I doing wrong?
Your help would be appreciated.

Reproduction

no

Steps to reproduce

No response

System Info

"scripts": {
    "dev": "next dev --turbopack",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "lint:fix": "next lint --fix",
    "format": "prettier --write ."
  },
  "dependencies": {
    "@storyblok/react": "^4.3.3",
    "next": "15.1.4",
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "@typescript-eslint/parser": "^8.19.1",
    "eslint": "^9",
    "eslint-config-next": "15.1.4",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-import": "^2.31.0",
    "eslint-plugin-playwright": "^2.1.0",
    "eslint-plugin-prettier": "^5.2.1",
    "eslint-plugin-react": "^7.37.4",
    "eslint-plugin-react-hooks": "^5.1.0",
    "eslint-plugin-simple-import-sort": "^12.1.1",
    "eslint-plugin-unicorn": "^56.0.1",
    "postcss": "^8",
    "prettier": "^3.4.2",
    "prettier-plugin-tailwindcss": "^0.6.9",
    "sass": "^1.83.4",
    "tailwindcss": "^3.4.1",
    "typescript": "^5"
  }

Used Package Manager

yarn

Error logs (Optional)

No response

Validations

@szabolcsveer szabolcsveer added pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised labels Jan 20, 2025
@szabolcsveer
Copy link
Author

@edodusi any thoughts pls? :)

@edodusi edodusi removed pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised labels Jan 21, 2025
@edodusi
Copy link
Contributor

edodusi commented Jan 21, 2025

@szabolcsveer I suggest you to open these kind of questions on our Discord community https://discord.gg/jKrbAMz, as is seems more like a setup issue than an issue with this SDK.

Also be sure to read the Next.js Ultimate Tutorial https://www.storyblok.com/tp/nextjs-headless-cms-ultimate-tutorial and setup a local https server, otherwise it won't work from the Visual Editor.

@alexjoverm alexjoverm added the needs-reproduction [Contribution] The issue requires minimal reproduction. label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-reproduction [Contribution] The issue requires minimal reproduction.
Projects
None yet
Development

No branches or pull requests

3 participants