Questions tagged [getstaticpaths]
34 questions
0
votes
0 answers
getStaticPaths works in development mode but not in netlify? How to handle more static pages?
I'm trying to build SSR application which generates static pages to display pokemon 0 to 160 showing 20 per page, so to do that I'm using getStaticPaths.
It works in development mode (npm run dev) but when I acess the '/products/1 to /8' in netlify…

Higor456
- 19
- 4
0
votes
1 answer
Nextjs getStaticPaths Error: getStaticPaths is required for dynamic SSG pages . NextJS
I have been trying to use getStatic props in my nextjs project, to pre-render the component for seo purpose. getStaticProps was used inside the pages and when i try to build the project it shows the following error.
"getStaticPaths is required for…

harshad
- 11
- 1
0
votes
1 answer
Environment variable doesn't work in getStaticPaths in NextJS
I would like to replace, in my getStaticProps, getStaticPaths and API routes, all mongodb connection URI strings by environment variables
From :
const client = await MongoClient.connect(
…

Keitaro
- 93
- 2
- 11
0
votes
1 answer
How can I use getStaticPaths with an authenticated external API in Next.js and Auth0?
I'm trying to use getStaticPaths to generate dynamic page routes in my Next.js application. However, in order to call my external API, I need to pass a Bearer token for authentication purposes. I'm using Auth0 for authentication and was wondering…

ck0mpana
- 33
- 4
0
votes
1 answer
Revalidation works only in the local mode
So, I have data which needs to be revalidated from a Firebase Realtime database. Everything works fine when I go for yarn run build and then yarn run start. But when I deploy the website to Vercel, the data does not get revalidated. How can I fix…

Kul
- 3
- 3
0
votes
0 answers
Sending a revalidation request once a Firebase Realtime database has been changed
So, recently I have been dealing with making a blog website where the user can both read everything I want to tell them in the text and leave a comment so that I can know their opinion.
I use markdown files to make the blog like that:
export async…

Kul
- 3
- 3
0
votes
1 answer
Unable to set up dynamic routing in NextJS for routes from Medium API
I seem to be having issues setting up dynamic routing in my Next app.I'm trying to display my Medium.com posts using the unofficial Medium API. I am able to display a list of cards on my homepage with the posts and I want each one to link to it's…

i-am-niall
- 152
- 1
- 12
0
votes
1 answer
Nextjs build successful on netlify but site css not accessible
My Nextjs site builds without error on netlify. But the site looks like this and does not pick up the css. The console shows a syntax error Uncaught SyntaxError: Unexpected token '<'. The routing also does not work.
This site works fine when…

RamlahAziz
- 47
- 10
0
votes
0 answers
Generate paginated URLs like ?page=2, ?page=3 etc. in NextJS getStaticPaths and access the query params in getStaticProps
I am building a NextJS based site with multiple locales (different domains) where the data comes from storyblok CMS (folder level translation).
I am trying to figure out the best approach to statically generate the paginated URLs for the blog and…

mrued
- 1
- 1
0
votes
1 answer
Error in Deployment of Next.js App to Vercel
I have trying to Develop a Next.js App using Next.js and my Custom Backend with Django. I have completed it Developing everything which I have wanted to but When I'm trying to Deploy it to Vercel It gives me Error with getStaticPaths Every time I do…

Aman Ojha
- 25
- 7
0
votes
0 answers
Nextjs Build Error: Export encountered errors on following paths /users/[userid]
i have created a nextjs app, i'm getting data from an express server deployed on netlify. i have created two pages, the first to display a list of users (i've got the users with getServerSideProps() function) and the second page is when you click on…

Elon Conner
- 11
- 1
- 2
0
votes
1 answer
NextJS routing error, when changing pages, the wrong file is trying to open
What I want
I want to change pages without next thinking I am trying to open another page.
The Problem
I have this weird routing problem.
First, my folder structure
pages
[app]
[object]
index.js
index.js
manager.js
feed.js
I…

Mähnenwolf
- 720
- 10
- 30
0
votes
0 answers
NextJS - getStaticPaths - Paths seems not bound to one of the params
My Next.js app's pages are provided by an API, each with a uri_prefix and a uri.
The uri_prefix is mandatory, and can be c or s for now. But any letter could be chosen in the end.
It's a pretty simple structure :
pages
|-[prefix]
| |
| …

Milk
- 23
- 4
0
votes
1 answer
getstaticprops cannot use params from getstaticpaths in case of dynamic routing? MongoDB
I am making a webpage which fetches data from mongoDB( atlas BASIC free plan) and has dynamic routing page with SSG. The dynamic routing page, [cogid].js, has getstaticpaths and getstaticprops. getstaticpaths seems work, but getstaticprops does not…

matskohe
- 21
- 3
0
votes
1 answer
getStaticPath and the need for filetype in the URL
In /pages I have [page].js and index.js.
[page].js generate needed Pages by the Value of "CustomPage". It's content comes from an Data-JSON-File.
It work like expected, as long as I start on the Homepage and use links inside of my Webpage.
For…

suther
- 12,600
- 4
- 62
- 99