Issue 1:
Bug report

The dynamic routing solution doesn't work at all

To Reproduce

I have this code using material-ui

I have this button

<Link
href='/r/[id]'
as={`/r/${selected.id}`}
passHref>
<Button component="a" variant="outlined" size="small">View Menu</Button>
</Link>

on the other page

import { useRouter } from 'next/router';
const Index = () => {
const router = useRouter()
console.log(router.query.id)
return (
)
}

The next.config.js

const withOffline = require('next-offline');
const withCSS = require('@zeit/next-css')

const nextConfig = {
target: 'serverless',
transformManifest: manifest => ['/'].concat(manifest),
workboxOpts: {
swDest: 'static/service-worker.js',
runtimeCaching: [
{
urlPattern: /^https?.*/,
handler: 'NetworkFirst',
options: {
cacheName: 'https-calls',
networkTimeoutSeconds: 15,
expiration: {
maxEntries: 150,
maxAgeSeconds: 30 * 24 * 60 * 60, // 1 month
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024
},
};

module.exports = withOffline(withCSS(nextConfig));

and the now.json

{
"version": 2,
"routes": [
{
"src": "^/service-worker.js$",
"dest": "/_next/static/service-worker.js",
"headers": {
"cache-control": "public, max-age=43200, immutable",
"Service-Worker-Allowed": "/"
}
}
],
"builds": [
{
"src": "next.config.js",
"use": "@now/next"
}
]
}

Expected behavior

Expect to move to a new route but nothing happens

System information

OS: Windows

Browser : chrome

Version of Next.js: [e.g. 9.0.6]

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

As stated in the title, for dynamic pages defined in the exportPathMap there are no generated index.js files. This brakes the next-router.

For example http://blog.schoenwald.media/_next/a7725bcd-89fa-4f04-950c-54d296a9e9d9/page/tag/css/index.js

As you can see here:

https://issue-3091.schoenwald-media.de

https://github.com/schoenwaldnils/blog/tree/issue-3091

next.config.js

Travis build (see line 4069 and following)

the generated files on gh-pages: https://github.com/schoenwaldnils/blog/tree/gh-pages

the generated pathMap:

{
"/": {
"page": "/",
"query": {
"posts": [{
"id": "6uzkBYXsME0CiSwMI8isSY",
"url": "/sticky-footer-with-flexbox"
}, {
"id": "4iJ3AOLOmIqykMw4qAKw4Y",
"url": "/hello-world"
}]
}
},
"/imprint": {
"page": "/page",
"query": {
"id": "5Wa2mgh3zOuku4GqOQEuAG"
}
},
"/about": {
"page": "/page",
"query": {
"id": "yBv8udv1XqwkEMmew0Wwi"
}
},
"/sticky-footer-with-flexbox": {
"page": "/page",
"query": {
"id": "6uzkBYXsME0CiSwMI8isSY"
}
},
"/hello-world": {
"page": "/page",
"query": {
"id": "4iJ3AOLOmIqykMw4qAKw4Y"
}
},
"/tag/css": {
"page": "/tag",
"query": {
"tag": "css",
"tags": ["css", "flexbox", "footer", "Hello", "world"],
"posts": [{
"id": "6uzkBYXsME0CiSwMI8isSY",
"url": "/sticky-footer-with-flexbox"
}]
}
},
"/tag/Hello": {
"page": "/tag",
"query": {
"tag": "Hello",
"tags": ["css", "flexbox", "footer", "Hello", "world"],
"posts": [{
"id": "4iJ3AOLOmIqykMw4qAKw4Y",
"url": "/hello-world"
}]
}
},
"/tag/world": {
"page": "/tag",
"query": {
"tag": "world",
"tags": ["css", "flexbox", "footer", "Hello", "world"],
"posts": [{
"id": "4iJ3AOLOmIqykMw4qAKw4Y",
"url": "/hello-world"
}]
}
},
"/tag/footer": {
"page": "/tag",
"query": {
"tag": "footer",
"tags": ["css", "flexbox", "footer", "Hello", "world"],
"posts": [{
"id": "6uzkBYXsME0CiSwMI8isSY",
"url": "/sticky-footer-with-flexbox"
}]
}
},
"/tag/flexbox": {
"page": "/tag",
"query": {
"tag": "flexbox",
"tags": ["css", "flexbox", "footer", "Hello", "world"],
"posts": [{
"id": "6uzkBYXsME0CiSwMI8isSY",
"url": "/sticky-footer-with-flexbox"
}]
}
}
}

Tech
Version

next
~4.0.3

node
8.4.0