Skip to content
Advertisement

Tag: next.js

I18N change language in Next.JS

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

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

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

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

Advertisement