Skip to content
Advertisement

Tag: next.js

defaultLocale is not keeping default lang in Next.js i18n

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

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

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

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

Advertisement