menu

Next.js

A place to chat about Next.js and answer questions. For all other ZEIT products, check this out.

Channels
Team
Posts
Chat
Members
Info
Show previous messages

September 10, 2019 at 5:53pm

Hi team

  • reply
  • like

I am running build and next ja do not parse the scss file

  • reply
  • like

September 11, 2019 at 12:43pm

Is there still technical support for Next 7, or will I be told to upgrade if I have questions?

  • reply
  • like

September 12, 2019 at 10:35am

Is there any solution for issue-8674

  • reply
  • like

How should I trigger a redirect to the signin page when my "protect" middleware doesn't find an auth cookie on the request? Using res.setHeader("Location", "/signin") doesn't seem to work.

  • reply
  • like

Hi everyone! I hope this is the right place to ask this.

  • reply
  • like

I am trying to use getInitialProps to query an API. I am keeping the API key in now secrets. Everything seems to work when I run the server locally with 'now dev', but when I deploy I am presented with a blank page, react doesn't load at all.

  • reply
  • like

I think the problem has something to do with the server being unable to read the API key from my secrets... but I'm really not sure, and I don't get any error messages in my console or build log.

  • reply
  • like

link to my blank page :\

  • reply
  • like
const API_STR = `https://app.ticketmaster.com/discovery/v2/events?apikey=${process.env.TMASTER_API_KEY}`;
Index.getInitialProps = async ({ req }) => {
if (req) {
const res = await fetch(API_STR + genreSearch(HIPHOP_GENRE_ID));
const json = await res.json();
return { events: json._embedded.events };
} else {
return {};
}
};
  • reply
  • like

my now.json file:

  • reply
  • like
{
"build": {
"env": {
"TMASTER_API_KEY": "@tmaster_api"
}
},
"env": {
"TMASTER_API_KEY": "@tmaster_api"
},
"public": true,
"github": {
"silent": true
}
}
  • reply
  • like

any idea where Im going wrong?

  • reply
  • like

September 13, 2019 at 8:40am

Hi there! I would appreciate some help regarding routing. I'd like to dynamically route /a to /search?q=a and /b to /articles/foo without actually redirecting (304). The logic of the routing is dynamic (an API actually does the mapping).

I ended up creating a dynamic root pages/[root].tsx and forwarded the calls to the respective page after figuring out which to display. However, subsequent routing with <Link> does not work, as the router is populated with the "wrong" pathname and query.

Is this the right approach, or is there an easier way to do this? If this is the correct approach, how can I "tweak" the router to have the correct state?

  • reply
  • like

Someone help me please?

I don't know how to use useEffect with NEXT JS

  • reply
  • like

The event is not firing

  • reply
  • like

September 14, 2019 at 2:20am

Hi Guys, I want to develop a server side rendered application. It will conatins 30k pages (including AMPs). I have data in mysql DB. I am new to NextJs.

1> From where I should start ? 2> What deployment platform shell I choose? (AWS, Google Cloud, etc) 3> How to manage CI/CD pipeline.

  • reply
  • like

September 14, 2019 at 9:11am

Can anybody help me setup a PWA with next-offline?

  • reply
  • like

I really don't understand what I'm doing wrong

  • reply
  • like

September 15, 2019 at 10:30am

Hello! first time i'm trying to use Next. Did npx create-next-app and it just installed the project with yarn tool. Can I opt-out of yarn? I prefer to use npm

  • reply
  • like

ok I found that I can get npm by passing --use-npm as well. never mind!

  • reply
  • like

How do I set up ESLint + Prettier for my newly created project?

  • reply
  • like

I tried the dynamic-routing sample, and it's working fine. I don't know what am I doing wrong here.

I'm wondering about the same thing. But I think that's a caching mechanism. It think it tries to preload the links on the page. So I'm assuming the 404's are normal

  • reply
  • like

September 16, 2019 at 8:02am