Skip to content

[Bug]: /api routes remove the query parameters on the req object #765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 2 tasks
koraysels opened this issue Nov 4, 2021 · 4 comments · Fixed by #826
Closed
1 of 2 tasks

[Bug]: /api routes remove the query parameters on the req object #765

koraysels opened this issue Nov 4, 2021 · 4 comments · Fixed by #826
Labels
status: needs reproduction this issue needs to provide a repo that reproduces the bug described type: bug code to address defects in shipped code

Comments

@koraysels
Copy link

koraysels commented Nov 4, 2021

Steps to reproduce

use the latest beta.4 or beta.5 version of netlify-plugin-nextjs v4
and add a file called test.js in the pages/api with the following content:

export default async function test(req, res) {
  res.status(200).json({query: req.query})
}

then deploy on netl;ify and test the route.. /api/test?foo=pbar

the result is

 {"query":{}}

and it shoud be

 {"query":{"foo":"pbar"}}

More information about your build

  • I am building using the CLI
  • I am building using file-based configuration (netlify.toml)

What OS are you using?

Mac OS

Your netlify.toml file

[build]
  command = "next build"
  functions = "netlify/functions"
  publish = ".next"

[[plugins]]
  package = "@netlify/plugin-nextjs"

other Relevant info:

When i downgrade back to 3.9.2 it works again..

@koraysels koraysels added the type: bug code to address defects in shipped code label Nov 4, 2021
@ascorbic
Copy link
Contributor

ascorbic commented Nov 5, 2021

Hi. Can you share a reproduction? I've had a few people report this, but haven't been able to reproduce it. Could you also send me the full request? If you open the network panel in dev tools, right click on the request and choose "Copy as cURL", then share it?

@ascorbic ascorbic added the status: needs reproduction this issue needs to provide a repo that reproduces the bug described label Nov 5, 2021
@koraysels
Copy link
Author

sure when i have time i'll try to set something up.. right now i lost alsmost a full day trying to figure out why my clients previews stopped working. ;)

@koraysels koraysels reopened this Nov 5, 2021
@koraysels
Copy link
Author

We reverted back to using v3.9.2.. now the initial load time is extremely slow.. but the preview function is working at least 😅

@ascorbic
Copy link
Contributor

ascorbic commented Nov 7, 2021

OK, glad it's working for you. If you do try again and reproduce the issue, please do send me the request details as it would be good to be able to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction this issue needs to provide a repo that reproduces the bug described type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants