-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Closed
Labels
status: confirmedIssue with steps to reproduce the bug that’s been verified by at least one reviewer.Issue with steps to reproduce the bug that’s been verified by at least one reviewer.type: bugAn issue or pull request relating to a bug in GatsbyAn issue or pull request relating to a bug in Gatsby
Description
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
Description
I'm trying to write a gatsby function, but it seems like webpack can't compile it.
I have create a repo which is base on hello-world starter and add a tiny function in it to reproduce this issue, you can find the link below.
Reproduction Link
https://github.com/Talaxy009/gatsby-function-issue
Steps to Reproduce
- Clone Reproduction Link
- Install dependencies
- Run gatsby develop
- Visit http://localhost:8000/api/hello
- You should be able to see the error from the browser and console
Expected Result
The /api/hello should return "hello"
Actual Result
The /api/hello return error message from webpack
Environment
System:
OS: Windows 10 10.0.22621
CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
Binaries:
Node: 18.16.1 - ~\AppData\Local\Temp\xfs-98c1ccf6\node.CMD
Yarn: 3.6.3 - ~\AppData\Local\Temp\xfs-98c1ccf6\yarn.CMD
npm: 9.5.1 - D:\Program Files\nodejs\npm.CMD
Languages:
Python: 3.10.9
Browsers:
Edge: Spartan (44.22621.2134.0), Chromium (116.0.1938.54)
npmPackages:
gatsby: ^5.12.1 => 5.12.1Config Flags
Nope
Metadata
Metadata
Assignees
Labels
status: confirmedIssue with steps to reproduce the bug that’s been verified by at least one reviewer.Issue with steps to reproduce the bug that’s been verified by at least one reviewer.type: bugAn issue or pull request relating to a bug in GatsbyAn issue or pull request relating to a bug in Gatsby

