I have some problems with I18N and NextJS. So I configured my I18N, everything works with default locale, but everything crashes if I want to change locale from local storage. In _app.js I tried to use this function: I have imported: When app is loaded it crashes and give error: I’m using the newest Next.js and I18N What I found
Tag: next.js
Typescript type error property does not exist
I have this component in my Typescript Next project This is what contact.styl looks like it is a CSS file using the Stylus CSS PreProcessor so there is no typo in the spelling of style. I recently fixed an error using a module declaration in my `next-env.d.ts’ file But I keep getting this error? Can anyone help me figure out
NextJs Authentication with Next-Auth against DRF
I have an exiting Django project that I am trying to move from templates to NextJs frontend. I came across Next-Auth-js which seems to be nice in Next Auth. However, the doc seems to focus more with JS related Backend Auth. Following this example I have sent the NEXTAUTH_URL environment variable to my DRF Endpoint localhost:8002. While the frontend runs
How do I reference a styled-component that is a functional component?
This is the most basic example I could think of: In this example, I want to style Foo component that is a descendent of div. I would expect the resulting markup to look something like: However, instead it is simply: It seems like no styling is applied anywhere. Furthermore, the component Foo is rendered only once, but it is invoked
Tailwindcss not working with next.js; what is wrong with the configuration?
For some reason, tailwind is not rendering properly in next.js. I’m wondering if something is wrong with my settings? Styles folder – tailwind.css @tailwind base; …. _app.js What am I doing wrong? so confused, usually this sort of setup is fine. This is the site btw – https://moodmap.app/ . using the information below, made changes and still same issue weirdly.
nextjs api not working when fetching through isomorphic-unfetch
Im not getting my data (notes) inside the props, it is giving undefined when im using console.log(notes). My backend api is also in the same project in /pages/api/notes/index.js The api which im calling is ‘http://localhost:3000/api/notes’ Even my api is working fine when im testing it on postman. But on the frontend, data isnt available Please checkout this issue. Answer I
How to get absolute URL in production?
The problem I’m facing is that I’m unable to get the absolute URL in the production build when using getStaticPaths and getStaticProps It works fine in the development build but when it comes to production it fails because the hardcoded https://websitename.vercel.app is not the one generated by vercel. The URL generated by vercel is something like this websitename-q1hdjf6c2.vercel.app. How do
Best practice for Next.js data fetching inside a component
I have a menu component that appears globally. What is the best practice for getting data into that component? I’m trying to take advantage of static generation that Next.js offers but all data fetching guidance from the Next.js team relates to pages. getStaticProps and getStaticPaths seem to pertain to page generation, not data for components. Is their SWR package the
API resolved without sending a response for /api/users/create, this may result in stalled requests. NEXTJS
I created an API endpoint to handle user account creation in my Next.js app, and I am using knex.js to handle my queries, but I still get this error: My code in /pages/api/users/create.js: Answer actually the bcrypt hash function is an async function, it returns a promise to be either resolved with the encrypted data salt or rejected with an
Warning: next-head-count is missing
I’m using a custom _document.js from Next documentation. In result, I keep getting a warning message printed out to the console. I’ve tried to restart my server and emptied my browser’s cache. My _document.js is inside a “pages” folder as it should be. I made sure that the file is being readen by adding some tags to my <Head> and