Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I uploaded my Next.js/Express app on AWS and it's failing at runtime for unknown reason.

I have the following AWS logs:

START RequestId: 27f88393-2541-11e8-af21-a362290178d9 Version: $LATEST
2018-03-11 16:30:42.490 (+01:00) 27f88393-2541-11e8-af21-a362290178d9 req from http://staging.loan-advisor.studylink.fr/
END RequestId: 27f88393-2541-11e8-af21-a362290178d9
REPORT RequestId: 27f88393-2541-11e8-af21-a362290178d9 Duration: 600.55 ms Billed Duration: 700 ms Memory Size: 256 MB Max Memory Used: 40 MB

START RequestId: 293c9c47-2541-11e8-9e47-bb956db55617 Version: $LATEST
2018-03-11 16:30:43.008 (+01:00) 293c9c47-2541-11e8-9e47-bb956db55617 req from http://staging.loan-advisor.studylink.fr/_next/fa74e99a-3209-47d0-b35e-096852884958/page/_error.js
END RequestId: 293c9c47-2541-11e8-9e47-bb956db55617
REPORT RequestId: 293c9c47-2541-11e8-9e47-bb956db55617 Duration: 123.53 ms Billed Duration: 200 ms Memory Size: 256 MB Max Memory Used: 40 MB

What I could deduce from those logs is that a request is handled at http://staging.loan-advisor.studylink.fr/ by Express and then a new request from http://staging.loan-advisor.studylink.fr/_next/fa74e99a-3209-47d0-b35e-096852884958/page/_error.js is handled.

Next loads correctly IMHO, since it's able to load the http://staging.loan-advisor.studylink.fr/_next/fa74e99a-3209-47d0-b35e-096852884958/page/_error.js script, which, I guess, displays a 404?

So, something is wrong when Next.js app tries to display something initially, but I have nothing to help me debug the issue 😕

Locally, everything works correctly, but I'm concerned about the lack of logs in the AWS environment, which makes it super hard to debug anything.

I did force quiet: false when instanciating my Next.js app but it doesn't have any effect.

Edit: I made a simple debug page at https://staging.loan-advisor.studylink.fr/debug which works fine and gets rendered correctly, so my first assumption is right, an exception happens in the index page which leads to throwing a 404 somehow. (instead of a 500 :/)

Issue 2:
Feature request

Is your feature request related to a problem? Please describe.

I see a lot of people using a separate component, just for adding an active class when a route is active. My suggestion is the add functional support for className in the link component.

To give an example:

import Link from "./link";

// Example using classnames package.
import cx from "classnames";

<Link className={active => cx({ "text-gray-200": active })} href="/">
<a>Home</a>
</Link>;

// Example using pure javascript.
<Link className={active => active && "text-gray-200"} href="/">
<a>Home</a>
</Link>;

Describe the solution you'd like

My solution is to allow className to be both a string and a function; When then component identifies the className as a function, call the method with the first argument is a boolean if the route is active then true else false.

Describe alternatives you've considered

An alternative solution is to implement the component yourself, as I have done so far.

Another way would be creating a component with an activeClassName attribute but this prevents support for class IntelliSense in editors as VSCode.

The reason I suggest this is because as the latest releases show, next.js is all about zero-config and not too much complexity. So why not implement such used feature into the existing Link component.

Additional context

My current solution to this request is using a custom component.

Made a gist to my component and a small example here: https://gist.github.com/ch99q/b417990540d2ef91870e1af99ac6a516