Most voted "next" questions
46 questions
Sort by count of
-
4
votes2
answers67
viewsWhat does the "jsx" prop do in Next.js' jsx <style?
In Next.js, we can insert direct styling into the component through the tag <style jsx>, as in the example: function Vitro() { return ( <div className="vitro"> <style jsx>{` .vitro…
-
3
votes2
answers196
viewsonClick error in Nextjs / React js
On the first tag <Link> is making a mistake in the onClick and I don’t understand why. Please help me out: import Link from 'next/link'; import React, { useState } from 'react'; export default…
-
3
votes1
answer685
viewsHow to get the url parameter in Nextjs
Guys, I have a question on Next JS, I have a page with name listid.js, when accessing for example http://localhost:3000/listid/10 I would like to receive id 10 as parameter on my page listid.js:…
-
1
votes1
answer893
viewsHow to create private routes with nextJs
Hello, I would like a help for creating private routes using Nextjs. All files deposited inside the directory pages become accessible routes, in my application some of these must be accessible when…
-
1
votes1
answer146
viewsImport inline SVG from Absolute path in Next.JS
I’m having trouble setting up Next.Js to make imports on absolute camino. I set up the tsconfig.json using the baseUrl as "src" and even works except in inline SVG files. I am using the…
-
1
votes0
answers102
viewsNextjs Error occurred prerendering pages
Export encountered errors on following paths: /blogs/categorias/[slug] TypeError: Cannot read property '0' of undefined export const getStaticPaths = async () => { const res = await…
-
1
votes1
answer127
viewsArray map and asynchronous functions
I’m using the function getStaticProps from Next.js and Axios to pick up news from Hacker News. My goal is to access the API that returns the main stories of the day (which returns a unique id of…
-
1
votes0
answers154
viewsHandle errors in Next.js and Axios
I’m making a Next.js application that uses Axios to make requests. The information I use of the API is coming normally but I would like to handle the returned errors better. Currently my code only…
-
1
votes1
answer44
viewsError in socket.io "expression cannot be called" in React/Next
I’m trying to make a Real Time Chat with socket.io with Next.js, but when it comes to importing and putting as constant is returning an error, I don’t understand because I’m about to make this code…
-
1
votes1
answer40
viewsHow to set a plugin settings next to Next.js settings?
I have a project that uses a dependency called @uiw/react-md-editor and, for it to work with Next.js, I need to create the file next.config.js and put this code: // next.config.js const…
-
0
votes1
answer80
viewsReact Nextjs - Path of the Undefined parameter after giving Refrech ( F5 ) on the page
Note: Eco Systems used here: Nextjs, Adonisjs and Mysql I have following code where I make a news presentation, what happens is the following... right after I come from the news listing, and select…
javascript node.js react adonisjs nextasked 4 years, 4 months ago Carlos Gustavo Souza Guimarães 42 -
0
votes0
answers170
viewsBug when rendering in production Nextjs fonts
Talk people! I’m creating a static website with Nextjs and Styled-Components. Everything happens well in the development environment, but when putting into production imports of sources do not work.…
-
0
votes0
answers66
viewsUsing query router with Nextjs
I’m creating a referral link to my site (someone will give this link to someone else, who will get a discount), when I use the link in environment on my machine, it usually works the router.query,…
-
0
votes0
answers32
viewsTypescript interface: Only one record per index
How to create an interface capable of only logging 1:1 in the IAgendaConfig through the attribute IAgendaDia.diaSemana (Prevent if there is no day of the week or if there is a duplicate on…
-
0
votes0
answers48
viewsI cannot use Onesignal in Reactjs/Next.JS
I’m making an implementation, using Next.JS and I’m using Onesignal to send push notifications to users. The big problem is that the public directory of index.html cannot be changed as it has many…
-
0
votes1
answer176
viewsTraverse a . map() in inside . map() React jsx
I’m using React with Typescript. Is it possible to go array inside an array? This is my array: const menu: Array<{name: string; to: string; icon?: ReactNode; submenu?: any}> = [ { name:…
-
0
votes0
answers21
viewsrender in nextJs
thank you so much for already paying attention here! <3 i in my landgpage, is presented 5 links, such links are saved in an array of Object and in each Object has the 5 links, and each position…
-
0
votes0
answers17
viewsrender Nextjs help I beg
import File from './File' function Index(){ const allPostsData = allPostsDataGet(); var page = 0; function change({target}){ page = target.textContent Index(); } return( <>…
-
0
votes1
answer286
viewsNext.js does not load jsx
Recently I’ve been researching about Next, the js framework of the moment, and I want to start training with it with some projects. The problem is it doesn’t run on my computer, no matter what I do.…
-
0
votes1
answer105
viewsWhat’s the difference between npm i -g create-next-app for npx create-next-app?
I created a Next.js project and in the terminal appeared the following: A new version of create-next-app is available! You can update by running: npm i -g create-next-app What is the difference and…
-
0
votes0
answers58
viewsApplication React/nextjs on Cpanel server with Nodeselector does not run
I am creating a React/nextjs application and deploying it on a Node Cpanel server (Node is through modpassenger and cloudlinux nodejs selector), I can install the dependencies normally using the npm…
-
0
votes0
answers10
viewsAxios - Server Error Error: Request failed with status code 404
I’m having a problem, I’m doing an authentication but this giving Error: Request failed with status code 404, and I don’t know what’s wrong with the url. import axios from "axios"; import {…
-
0
votes1
answer263
viewsNextjs with Typescript and Styled-Components not working
I’m trying to use the Styled-Components in my Nextjs application, but always returns an error, do not understand why it is not working. to start the project I used the command: npx create-next-app…
-
0
votes1
answer22
viewsHow to take all consoles.logs, errors, and alerts from the console to cleinte (devtools)
I have a next.JS application and I need it to be well indexed. I’m making some changes and improvements following Lighthouse. However a mistake of "good practices" appeared that I always had doubts.…
-
0
votes1
answer81
viewsReact component array with Typescript(.tsx)
I have a small project using Next.js, React and Typescript. The idea is that a set of values within an array in a . json file be transformed into the React components and placed on the page…
-
0
votes0
answers22
viewsCkeditor 5 does not work on Next.JS
I’m making the following mistake: Unhandled Runtime Error Error: Element type is invalid: expected a string (for built-in Components) or a class/Function (for Composite Components) but got:…
-
0
votes1
answer60
viewsNextjs pass a JSON to another page
Good afternoon! I’m having a question and I even managed to do it via Route.Push() but all the data is displayed in the URL of the next page. An example: I have a Login page where I pass a CPF/CNPJ…
-
0
votes0
answers49
viewsModify SVG with Styled-Components (React/next)
The problem is specific and found nowhere. Summary: How I could modify the properties of my standard JSX SVG icon directly in Styled-Components as well as other icons? Details: I know with…
-
0
votes1
answer49
viewsCheck Image URL before updating State in React/Next
The logic below is: React/Nextjs with Styled-Components. Hello, I have a component that "renders" the banner of a blog (background-image), the url comes from a state that already has a standard…
-
0
votes1
answer82
viewsNEXT.JS - Server Error: Must use import to load ES Module: C: Users ... nextjs-blog node_modules Remark index.js
Guys, I followed the tutorial of the official website of Next.js in this link ( https://nextjs.org/learn/basics/dynamic-routes/render-markdown ) and I got the following error: "Server Error Error:…
-
0
votes0
answers63
viewsError: Objects are not Valid as a React Child (found: Object) If you Meant to render a Collection of Children, use an array Instead. nextjs/typescript
I have the following problem with nextjs/typescript I have a cart context where is giving the second message, I tried to change the types already tried to do several things but the error persists,…
-
0
votes0
answers11
viewsGlobal CSS related error while running project
I have two other projects with the same file structure and that are running (npm run dev) usually but this third one ends in error and does not render the default page of a project with next.js.…
-
-1
votes1
answer39
viewsCSS does not load into static build (next export)
I’m using Yarn create next-app, for my first site project on React. So I used export to generate the static site and moved the "out" folder to the server to see the result. But apparently all the…
-
-1
votes0
answers5
viewsHow to import a React component with Styled-Components in next using monorepo?
I’m using monorepo with Lerna and Yarn workspaces in a nextJS project, I can run the project but I can’t reuse components when I put Styled-Components in them. There’s always a mistake: Module parse…
-
-1
votes1
answer170
viewsBecause when I install Axios in my next application I can’t run it?
I’m learning Nextjs and wanted to create a project with Next and Axios but whenever I install Xios the application stops working. Note: this project also has Typescript and Styled-Components…
-
-1
votes1
answer45
viewsHow to return a message to the Fronteend after checking an API in Reactjs
I am making a registration form in Nextjs, working ok, the inputs takes the user input data via reactJS FETCH API and sends to a MYSQL database, Until here ok, what I’m cracking my head is time to…
-
-1
votes2
answers65
viewsProblem with Next, Typescript and Eslint
I’m starting a project with Next, Typescript, Eslint and Prettier. After starting the project, adding Typescript, Eslint and Prettier started getting an error that I can’t find a solution to, I…
-
-1
votes1
answer23
viewsError building my project in Nextjs
I am having problems building my project for Vercel, if it is necessary to look at the code of my project it is here https://github.com/lucasbpereira/lgpdmap yarn build yarn run v1.22.5 $ next build…
-
-1
votes0
answers5
viewsHow to protect routes that already exist in a next.js app without replicating getServerSideProps on all pages
I am mounting an authentication in an existing next.js app and need to protect the routes. The best way I found is by using cookie and the getServerSideProps method so that when a protected route is…
-
-1
votes0
answers7
viewsI need to take information from the nextAuth service profile function and forward it to the browser
Hello I am making an app that uses as authentication a backend of its own, and in the authentication with google I am using next-auth, it sends the tokenid to the api via post and with that the…
-
-1
votes1
answer9
viewsHow to make Nextjs not return props before getStaticProps has completed all requests (Promises)?
Within the function getStaticProps I take some data from the database and perform in them some treatments to suit the way I will use them. Everything happens exactly as it should, except that…
-
-2
votes3
answers130
viewsTable with data array
Why the table only appears data if you set the position of the element in the array? import React from 'react' import Head from 'next/head' import { Table } from 'reactstrap' import axios from…
-
-2
votes1
answer88
viewsconst returns Undefined when using the getServerSideProps method of Next.js
Hello, I am using React with Next.js and using the native Next.js method, getServerSideProps to retrieve browser cookies. It turns out that the breakdown works for the first const, but not for the…
-
-2
votes2
answers106
views"Internal Server Error" error on localhost:3000 server when using the npm run dev command
I’m studying Nextjs and used the npm create-next-app command to create a next template, but when I use the npm run dev command, which should open the application on port 3000, localhost:3000 returns…
-
-2
votes1
answer88
viewsNextjs does not run in Visual Studio Code, but works in command prompt
Hello, I created a standard Nextjs application using "npx create-next-app teste", I have not changed any standard file and Windows command prompt (CMD), when I use commands like "npm start", "npm…
-
-2
votes0
answers6
viewsError setting up context.Provider in a next.js project
Following staff, I started a project using Next.js, and after inserting some codes, I needed to create a Provider (myContext) to create global states, but when configuring Provider, my application…