Skip to content
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

Example with-mysql build bug #19635

Closed
farhankk360 opened this issue Nov 28, 2020 · 1 comment · Fixed by #19636
Closed

Example with-mysql build bug #19635

farhankk360 opened this issue Nov 28, 2020 · 1 comment · Fixed by #19636
Labels
examples Issue was opened via the examples template. good first issue Easy to fix issues, good for newcomers

Comments

@farhankk360
Copy link
Contributor

Bug report

Describe the bug

I was trying out this new example from examples/with-mysql works fine locally but when I try to build it using yarn build it throws a build time error.

Its related to this: #19452

Link to the example: https://github.com/vercel/next.js/tree/canary/examples/with-mysql

To Reproduce

  1. yarn build

Expected behavior

Build to succeed eg.

yarn build
yarn run v1.22.5
$ next build
Loaded env from D:\dev-stuff\next.js\examples\with-mysql\.env.local
info  - Creating an optimized production build
info  - Compiled successfully
info  - Collecting page data
info  - Generating static pages (5/5)
info  - Finalizing page optimization
...

Screenshots

image

$ yarn build
yarn run v1.22.5
$ next build
Loaded env from D:\dev-stuff\next.js\examples\with-mysql\.env.local
Failed to compile.

./pages/api\get-entry.ts:10:25
Type error: Argument of type 'string | string[]' is not assignable to parameter
of type 'string'.
  Type 'string[]' is not assignable to type 'string'.

   8 |       return res.status(400).json({ message: '`id` required' })
   9 |     }
> 10 |     if (typeof parseInt(id) !== 'number') {
     |                         ^
  11 |       return res.status(400).json({ message: '`id` must be a number' })
  12 |     }
  13 |     const results = await query(
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
and.

System information

  • OS: Windows 10
  • Browser: Chrome 86.0.4240.198 (Official Build) (64-bit)
  • Version of Next.js: 10.17.0
  • Deployment: yarn build
@farhankk360 farhankk360 added the bug Issue was opened via the bug report template. label Nov 28, 2020
farhankk360 added a commit to farhankk360/next.js that referenced this issue Nov 28, 2020
@timneutkens timneutkens added good first issue Easy to fix issues, good for newcomers examples Issue was opened via the examples template. and removed bug Issue was opened via the bug report template. labels Nov 30, 2020
@balazsorban44
Copy link
Member

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.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue was opened via the examples template. good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants