Issue 1:
npm run build -> (next build) is working locally but on the production web server with the same code it gives the following error log:

0 info it worked if it ends with ok
1 verbose cli [ '/root/.nvm/versions/node/v8.6.0/bin/node',
1 verbose cli '/root/.nvm/versions/node/v8.6.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm@5.4.2
3 info using node@v8.6.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle frontend@1.0.0~prebuild: frontend@1.0.0
6 info lifecycle frontend@1.0.0~build: frontend@1.0.0
7 verbose lifecycle frontend@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle frontend@1.0.0~build: PATH: /root/.nvm/versions/node/v8.6.0/lib/node_modules/npm/bin/node-gyp-bin:/var/www/app/frontend/node_modules/.bin:/root/.nvm/versions/node/v8.6.0/bin:/root/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle frontend@1.0.0~build: CWD: /var/www/app/frontend
10 silly lifecycle frontend@1.0.0~build: Args: [ '-c', 'next build' ]
11 silly lifecycle frontend@1.0.0~build: Returned: code: 137 signal: null
12 info lifecycle frontend@1.0.0~build: Failed to exec build script
13 verbose stack Error: frontend@1.0.0 build: `next build`
13 verbose stack Exit status 137
13 verbose stack at EventEmitter.<anonymous> (/root/.nvm/versions/node/v8.6.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack at emitTwo (events.js:125:13)
13 verbose stack at EventEmitter.emit (events.js:213:7)
13 verbose stack at ChildProcess.<anonymous> (/root/.nvm/versions/node/v8.6.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:125:13)
13 verbose stack at ChildProcess.emit (events.js:213:7)
13 verbose stack at maybeClose (internal/child_process.js:927:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid frontend@1.0.0
15 verbose cwd /var/www/app/frontend
16 verbose Linux 4.4.0-71-generic
17 verbose argv "/root/.nvm/versions/node/v8.6.0/bin/node" "/root/.nvm/versions/node/v8.6.0/bin/npm" "run" "build"
18 verbose node v8.6.0
19 verbose npm v5.4.2
20 error code ELIFECYCLE
21 error errno 137
22 error frontend@1.0.0 build: `next build`
22 error Exit status 137
23 error Failed at the frontend@1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 137, true ]

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

Your Environment

Tech
Version

next
3.2.2

node
8.6.0

OS
ubuntu 16.04

Issue 2:
Here's the URL looks like,

www.mydomain.com/suresh/450

Here suresh is parsed as "username" and 450 is parsed as "amount". Here's the server.js code

`const express = require("express");

const { parse } = require("url");

const next = require("next");

const dev = process.env.NODE_ENV !== "production";

const app = next({ dev });

const handle = app.getRequestHandler();

app

.prepare()

.then(() => {

const server = express();

server.get("/", (req, res) => {
return handle(req, res);
});
server.get("/get-link", (req, res) => {
return handle(req, res);
});
server.get("/:username/", (req, res) => {
const actualPage = "/processor";
const mergedQuery = Object.assign(
{},
{ reqQuery: req.query },
{ reqParams: req.params }
);
console.log('req', req);
console.log('cProps', cProps);
return app.render(req, res, actualPage, { cProps: mergedQuery });
});

server.get("/:username/:amount", (req, res) => {
const actualPage = "/processor";
const mergedQuery = Object.assign(
{},
{ reqQuery: req.query },
{ reqParams: req.params }
);
return app.render(req, res, actualPage, { cProps: mergedQuery });
});

server.get("*", (req, res) => {
return handle(req, res);
});

server.listen(3005, err => {
if (err) throw err;
console.log("> Ready on http://localhost:3005");
});

})

.catch(ex => {

console.error(ex.stack);

process.exit(1);

});

`

In Dev mode, this URL www.mydomain.com/suresh and **www.mydomain.com/suresh/450**is working as expected, But after build and running in production its showing 404.

Here's my package.json

{ "name": "stellar-me", "version": "1.0.0", "scripts": { "dev": "node server.js", "build": "next build", "start": "NODE_ENV=production next start" }, "dependencies": { "next": "5.0.0", "express": "4.16.2", "next-redux-wrapper": "^1.0.0", "react": "16.2.0", "react-dom": "16.2.0", "react-redux": "^5.0.1", "redux": "^3.6.0", "redux-devtools-extension": "^2.13.2", "redux-thunk": "^2.1.0", "stellar-sdk": "^0.8.0" }, "license": "ISC" }

Please let me know whats happening.

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

Your Environment

Tech
Version

next
5.0.0

node
6.10.3

OS
Ubuntu 16.04

browser
Chrome

etc