I’m trying to make my default language in Next.js i18n but always is getting “En” as default language called like fallback. And I also get this error: Error: [@formatjs/intl Error MISSING_DATA] Missing locale data for locale: “sq” in Intl.NumberFormat. Using default locale: “en” as fallback Answer Next.js will automatically detect which locale the user prefers based on the Accept-Language header
Tag: next.js
add block-input from sanity.io to next.js blog post
I’m developing a blog on next.js with sanity.io, and I’m having trouble using the code-input plugin. What I do have I’m able to use the code component block on sanity, which looks something like this: Everything good on the sanity side. My problem comes with using it on the next.js [slug].js file. I have this error prompt out: This issue
Does Next.js SSG support dyamic data?
I am making a webapp using Next.js and have a question regarding the Static generated sites. My webapp is a blog, and requires a path for each blog entry in the database. If I were to statically generate my webapp and host it on Vercel, would the getStaticPaths function update the paths when a new entry is added? Answer That
Next.js, Strapi – Fetch response is empty
I have nextjs frontend that fetch data from strapi backend. Problem is that data is empty even if i can see on strapi dev logs that request has been made. This is next.js code And here is the strapi log But I don’t know why is data empty. Truth is that the response consist of base64 long text but I
Return multiple queries using Apollo
I am using nextJS for my frontend with apollo and a graphql. And I fetching my queries using the getStaticProps() function. To increase modularity and maintainability I break my queries into multiple queries. I have a folder structure like: src/queries getPost.js getMenu.js getProduct.js index.js And their all queries are put and exported into index.js. The problem is because of multiple
“Cannot use import statement outside a module” error when importing react-hook-mousetrap in Next.js
Trying out Next.js but I’m struggling with the following. Just tried to install react-hook-mousetrap and imported it like I normally would: This gives me the following error: I am not sure what this means? I then thought it might be a problem with Nextjs’s SSR, since my library enables hotkeys and will use some browser APIs. If you already know
Next.js router locale issue
I have set up some locales for our app which are uk and us. For the blog we can have either us/blog or just /blog for the uk locale. When I switch to us like so: (locale = “us”) the url gets correctly updated to have us/ prepended. When I switch back to uk using handleRoute (locale= “”), it stays
Next.js viewport meta tags should not be used in _document.js’s
I want to use the viewport meta tag to disable the page zoom in the _document.js file in the Next.js. But it’s not working and says viewport meta tags should not be used in _document.js’s <Head>. How can I fix it? Answer Meta tags added to the custom _document cannot be deduped. This means the proper way to overwrite the
How to render custom generated ruleset in styled-jsx
TL;DR How does one insert a variable that contains one or more CSS rules into styled-jsx (using styled-jsx-plugin-sass under the hood)? I have the following JSX style: And contained is a variable that I’m trying to insert into it the mentioned rule: Notes: breakAt is a function that generates a specific media query (breakpoint: string) => (content: string) => string
object` (“[object Response]”) cannot be serialized as JSON?
I am trying to consume my api through code I am getting this error object` (“[object Response]”) cannot be serialized as JSON But when I call or use this api through browser I am getting response. here is my code https://codesandbox.io/s/naughty-platform-1xket?file=/pages/index.js I am consuming my api like this API design I am getting this console value on server. but when