Giter Club home page Giter Club logo

Comments (6)

PaulBratslavsky avatar PaulBratslavsky commented on September 26, 2024 2

@ugoarzur I just did the set up to test the app and everything worked. Here is the video I recorded as I was trying to reproduce you issue.

issue-reproductionext-setup.mp4

Also, we have open office hours on Strapi's Discord, you can stop by and we can look at your issue together.

https://discord.com/invite/strapi

Mon - Fri 12:30 PM CST time.

from nextjs-corporate-starter.

locnt19 avatar locnt19 commented on September 26, 2024 2

HI @custards, Could you try creating an API with Full Access and put it in the .env file in the frontend folder to try to resolve this issue? If it works, you can change the API Token permission later.

image

image

from nextjs-corporate-starter.

PaulBratslavsky avatar PaulBratslavsky commented on September 26, 2024 1

@ugoarzur I am going to see if I can reproduce your issue, in terms of the link you shared here it refers to the pages folder structure, but here we are using app router.

I will see if I can recreate it and see if I get the same issue. Thank you for bringing this to my attention.

from nextjs-corporate-starter.

PaulBratslavsky avatar PaulBratslavsky commented on September 26, 2024

This error is thrown when you add invalid API Token in your frontend. Make suer you added the correct token in your frontend .env file.

NEXT_PUBLIC_STRAPI_API_TOKEN=your-api-token
NEXT_PUBLIC_PAGE_LIMIT=6
NEXT_PUBLIC_STRAPI_FORM_SUBMISSION_TOKEN=your-form-submission-token
NEXT_PUBLIC_STRAPI_API_URL=http://localhost:1337

from nextjs-corporate-starter.

ugoarzur avatar ugoarzur commented on September 26, 2024

Hi 👋🏻

I was curious to give it a try but I found this very same issue although I followed this guide from Vercel, generated my api tokens from the strapi dashboard and inserted them into my frontend/.env file.

I am not a frontend expert but (to me) window is not defined seems more related to a frontend absence of the window because the components may have been generated from the server.
According to the Next.js SSR Component Documentation this behaviour is an SSR component and therefore there is no window in server.

To use Server-side Rendering for a page, you need to export an async function called getServerSideProps. This function will be called by the server on every request.

from nextjs-corporate-starter.

custards avatar custards commented on September 26, 2024

Hey! I really appreciate your help with the issue and even providing a walkthrough. I was actually able to get it to work by regenerating more tokens. Only difference was that I set a duration of unlimited this time instead of 7 days when I first reported the issue. Couldn't really say why this had the effect it did as I did try new tokens multiple times but maybe something was botched on my end that I didn't notice.

from nextjs-corporate-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.