{"id":21607358,"url":"https://github.com/maccyber/next-custom-route-issue","last_synced_at":"2025-03-18T15:20:56.973Z","repository":{"id":82105842,"uuid":"183789042","full_name":"maccyber/next-custom-route-issue","owner":"maccyber","description":"Issue with custom route in now-dev","archived":false,"fork":false,"pushed_at":"2019-04-27T15:20:11.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T19:34:34.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maccyber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-27T15:19:14.000Z","updated_at":"2019-05-04T16:56:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"defd9cce-9ddc-40c4-9562-84f75192bb83","html_url":"https://github.com/maccyber/next-custom-route-issue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maccyber%2Fnext-custom-route-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maccyber%2Fnext-custom-route-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maccyber%2Fnext-custom-route-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maccyber%2Fnext-custom-route-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maccyber","download_url":"https://codeload.github.com/maccyber/next-custom-route-issue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244246552,"owners_count":20422459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T20:30:04.694Z","updated_at":"2025-03-18T15:20:56.953Z","avatar_url":"https://github.com/maccyber.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Describe bug\n\nI'm having troubles with custom routes in next.js when running through `now dev`\n\nI have defined a custom route in `now.json`\n\n```json\n  \"routes\": [\n    { \"src\": \"/product/(?\u003cname\u003e[^/]+)\", \"dest\": \"/product?name=$name\" }\n  ]\n```\n\nIn `pages/product.js` `query.name` is passed from `getInitialProps`\n\n```js\nProduct.getInitialProps = async ({ query }) =\u003e {\n  console.log(query.name || 'NOT FOUND') // returns \"NOT FOUND\" when accessing\n                                         // http://localhost:3000/product/test\n  return { name: query.name }\n}\n```\n\n## To Reproduce\n\n```\ngit clone https://github.com/maccyber/next-custom-route-issue\nnpm i\nnow dev -d\nopen http://localhost:3000/product/test\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaccyber%2Fnext-custom-route-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaccyber%2Fnext-custom-route-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaccyber%2Fnext-custom-route-issue/lists"}