storyblok / next.js-13-boilerplate

21 stars 12 forks source link

Template doesn't work #3

Open benjifriedman opened 1 year ago

benjifriedman commented 1 year ago

Hi, I followed the steps to install and am getting this error in the console. I used npm and not yarn. Let me know if you need any other information.

-  ┌ GET / 200 in 296ms
   │
   └──── get https://api.storyblok.co../v2/cdn/stories/home?version=draft&t.. 401 in 262ms (cache: MISS)

- wait compiling /favicon.ico/route (client and server)...
- event compiled client and server successfully in 321 ms (616 modules)
- warn Fast Refresh had to perform a full reload due to a runtime error.
- error { source: 'server', message: {} }
- error {
  name: 'Error',
  source: 'server',
  message: 'Error: [object Object]',
  stack: '',
  digest: '294329633'
}
arorachakit commented 1 year ago

Hey @benjifriedman ! May I know which token are you using from Storyblok?

benjifriedman commented 1 year ago

Hi @arorachakit, I have a "demo space" and another space in the Storyblok admin. The other space (the one I got the error on) had access level "Preview". I see in the demo space there are three tokens. The Theme access level results in an error, Preview results in a blank page, and Public also results in an error. It just says

Unhandled Runtime Error
Error: Error: [object Object]
arorachakit commented 12 months ago

You should be using either the preview or public token. Though there can a few cases why it isn't working. Public token only gives you the access to published data, and if you try to retrieve draft content with that, then it will throw an error.

Also, it could be an issue when you are trying to retrieve published data but nothing is published. Since you say preview results in a blank page, then I assume there is no error there and something might be wrong on the front end side.

Are you replacing the token at both the places in the Next project? Also, going through the tutorial here might be of help - https://www.storyblok.com/tp/add-a-headless-cms-to-next-js-13-in-5-minutes

arorachakit commented 11 months ago

Hey @benjifriedman ! Were you able to resolve it?

benjifriedman commented 11 months ago

@arorachakit Thanks for checking in. I still see the blank page with the preview token, a runtime error with the public token. The main thing is that in Storyblok, I see "page.liquid is missing" on the homepage and landing page

arorachakit commented 11 months ago

@benjifriedman - did you change the preview URL? This is strange, and shouldn't happen usually. There might be something missing in the setup.

Did you follow the tutorial yet? Or did you try to clone and see the differences?

jonvillalobos commented 11 months ago

Also experiencing the template not working. I followed the steps and attempted it multiple times.

event compiled successfully in 128 ms (326 modules)

arorachakit commented 11 months ago

Hey @jonvillalobos - are you using your access token at both of the required places?

yeuem1vannam commented 11 months ago

The Template does not work for me either. I've just do a quick check:

image image image image image
arorachakit commented 10 months ago

Hey @yeuem1vannam ! Are you replacing the token at both places? I mean here as well - https://github.com/storyblok/next.js-13-boilerplate/blob/main/components/StoryblokProvider.js#L13C33-L13C33

tylerlov commented 9 months ago

same issues here, token in both places but no luck. I at least get "Unhandled Runtime Error Error: Error: [object Object]" instead of a blank page

LeanderG commented 6 months ago

Also doesn't work for me. I replaced the token in both places. I'm on node v20.11.1. npm run dev works.

npm run build on next version 13.4.2 gets stuck with this message:

- info Collecting page data  
[    ] - info Generating static pages (0/4)TypeError: _err_message.includes is not a function

On next version 14.2.2 it also doesn't work and throws this error:


TypeError: u.includes is not a function