next.js icon indicating copy to clipboard operation
next.js copied to clipboard

path-to-regexp error /next/node_modules/path-to-regexp/dist/index.js:113

Open ERRORthenBSOD opened this issue 6 years ago • 2 comments

After i upgraded next to 9.1.5 from 9.1.4 i can`t run it in production. I got express and my command is NODE_ENV=production node server.js

And it gives me:

.../node_modules/next/node_modules/path-to-regexp/dist/index.js:113 throw new TypeError("Unexpected " + nextType + " at " + index + ", expected " + type); ^

TypeError: Unexpected MODIFIER at 72, expected END at mustConsume (.../node_modules/next/node_modules/path-to-regexp/dist/index.js:113:15) at parse (.../node_modules/next/node_modules/path-to-regexp/dist/index.js:172:9) at stringToRegexp (.../node_modules/next/node_modules/path-to-regexp/dist/index.js:329:27) at pathToRegexp (.../node_modules/next/node_modules/path-to-regexp/dist/index.js:403:12) at Object.match (.../node_modules/next/node_modules/path-to-regexp/dist/index.js:248:14) at Object.route (.../node_modules/next/dist/next-server/server/lib/path-match.js:6:42) at .../node_modules/next/dist/next-server/server/next-server.js:386:37 at Array.forEach () at Server.generatePublicRoutes (.../node_modules/next/dist/next-server/server/next-server.js:381:21) at Server.generateRoutes (.../node_modules/next/dist/next-server/server/next-server.js:146:20)

I tried it also with server.js from https://github.com/zeit/next.js/blob/canary/examples/custom-server-express/server.js - same error.

Also: now after my yarn.lock or package.lock changed i get this error no matter what 9 version of next i install. On 8 version there is no such error

ERRORthenBSOD avatar Dec 11 '19 11:12 ERRORthenBSOD

Please follow the issue template and provide a clear and concise reproduction as asked for.

timneutkens avatar Dec 11 '19 11:12 timneutkens

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

balazsorban44 avatar Jan 30 '22 21:01 balazsorban44