The problem with the Next.js 14 generateStaticParamsparams parameter is that it is currently

I'm using this documentation as a reference to extract parameters from the URL in my generateStaticParams function: https://nextjs.org/docs/app/api-reference/functions/generate-static-params#generate-params-from-the-bottom-up

This is the route I am working with:

app/[productType]/[coverType]/[make]/page.tsx

Here's my implementation:

export async function generateStaticParams({
  params: { productType, coverType },
}: {
  params: { productType: string; coverType: string };
}) {
  console.log('GenerateStaticParams:', { productType, coverType });
  const makeData = await getAllMakes({
    type: productType,
    cover: coverType,
  });

  return makeData.filter(Boolean).map((make) => ({
    make: make,
  }));
}

Both productType and coverType are currently undefined. Is there an issue with my approach? Or could it be because I am not generating the parameters from the top down?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Learn how to implement scrolling text using JavaScript and jQuery, where text slides by clicking on the previous and next icons

click here to see the image Is it possible to create a text slider that moves when clicking on previous and next icons? I want only 10 texts to be visible at a time, with the rest hidden. When clicked, all the texts should appear. Unfortunately, I don&apo ...

Other options besides re-flowing and repainting

After doing some research on various platforms like Stack Overflow, I've come across information stating that re-paints and re-flows can be quite taxing on a browser's resources. I am interested in learning about alternative CSS/JS techniques to ...

Twilio's phone calls are programmed to end after just 2 minutes

For the past week, I've been dealing with a frustrating issue where calls are being automatically disconnected after 2 minutes of recording. Here is the TwiML code: <Response> <Say voice="woman" language="en">Hii Welcome to our App</Sa ...

Prevent the need to keep deleting text when entering data into selectize.js <select>_dropdown

I am working with a single choice <select> element that has been enhanced using selectize.js. This <select> element already has an option pre-selected as the current value. To change this value, users must: Click on the drop-down control, Pr ...

Determining if a map array value is being duplicated with a distinct key in JavaScript

I am facing an issue with a Map that has "String" as keys and "Array" as values. My problem is figuring out how to check if an array item is present in a different "Array" value, specifically in the "Array" of a different key within the map. For example: ...

Nextjs encountering Backblaze B2 CORS problem

Greetings everyone! I am currently in the process of setting up Backblaze for a Next.js app. However, I am encountering a CORS error. Initially, I assumed it was due to the bucket configuration and set custom CORS rules, but the issue persists as I receive ...

Tips for accessing a variable located in a different directory

I'm facing some confusion regarding creating a global variable that can be accessed in another file. Currently, I have a chat and login folder setup. Within the login folder, there are three possible users to choose from. When a user clicks on one of ...

Tips for creating a customized dropdown menu that opens upwards without relying on Bootstrap

Looking for some assistance with creating an animated dropdown menu that slides upwards. Any help is appreciated! $('.need-help').click(function() { $('.need_help_dropdown').slideToggle(); }); .need-help { background:url(../im ...

A helpful tip for dynamically adjusting the canvas size is to utilize its height and width attributes to resize it whenever it undergoes a change

I am encountering an issue with the canvas element in my code. The canvas is supposed to update whenever its containing div is resized. window.addEventListener('resize',function() { let mapwidth = $('.canvas').attr("width") l ...

Implementing a feature to automatically set the datepicker value to the selected date upon page initialization

I am working with a datepicker element, identified by id="from_dt", and a button with id="fromToDate". When a date is selected from the datepicker and the button is clicked, the page will load. At that point, I want to transfer the selected date to a textb ...

Tips for creating uniform image sizes within the Next Image component

Check out my NextJS app on CodeSandbox here. In this project, I am using Tailwind CSS for styling and rendering a list of products. Each product is displayed in a card with an image. I am utilizing the NextJS Image component for image rendering, but I am f ...

An error message pops up when using Next.js with Sass, indicating that a suitable loader is required to handle this file type

I've been struggling to properly wire up my next.js project with SCSS, but no matter what I try, it just won't work. I double-checked my setup for compiling SCSS files, but the error message keeps popping up: /scss/style.scss 1:0 Module parse f ...

What is the best way to make a JSONP request using jQuery?

Whenever I try to access this API through the browser, everything works fine and I receive the correct response. However, when I attempt to call the API using jQuery AJAX, I encounter an error. *The script is being refused execution from 'http://api ...

Encountering a Material UI error: Incorrect hook usage when combining create-react-library with MUI

After transitioning from Material Ui v3 to v4 on a create-react-library project, I encountered an issue. This particular project serves as a dependency for other projects in order to share components. However, when attempting to display a material-ui compo ...

What is the best way to invoke an API two times, passing different parameters each time, and then merge both responses into a single JSON object using a callback function?

This code snippet is currently functional, but it only retrieves the JSON response for the first set of parameters. I am looking to make multiple calls to an external API with different parameters and then combine all the responses into one concatenated J ...

Preventing links from functioning on dynamically generated web pages

I have implemented the following code to deactivate all links on a preview page: var disableLink = function(){ return false;}; $('a').bind('click', disableLink); While this successfully disables all static links, any anchor tags loade ...

`In AngularJS, the same URL ('/') can display different templates depending on the user's login status.`

What is the most effective way to configure routing and templates in AngularJS to display a distinct front end and login area for visitors, while presenting a dashboard to logged-in users all on the same base URL ('/')? These two pages have comp ...

What could be causing the url in my checkout API to not be valid?

In my checkout process using Next.js and MongoDB, I implemented a payment Stripe session in the API. Here is the code snippet: import {initMongoose} from "../../lib/mongoose"; import Product from "../../models/Products"; import Order ...

Tips for avoiding event listeners from being triggered multiple times

Implemented an event listener on an HTML element that was retrieved by className within the render method of highcharts, but for some reason, the listener is being triggered twice. The issue seems to be with the onClick handler in the highchart's rend ...

Using React to store information in localStorage

Currently, I am developing a website to showcase an alcohol brand. To enhance the user experience, I want to display a modal component only upon the initial visit of the site and not on subsequent visits. The modal component, named "legalAge," serves the ...