Skip to content

Commit

Permalink
fix(functions): Fix context variable warning/error (redwoodjs#10556)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed May 9, 2024
1 parent ee4e784 commit ab9d6cf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changesets/10556.md
@@ -0,0 +1,7 @@
- fix(functions): Fix context variable warning/error (#10556) by @Tobbe

In a newly generated function there's a warning/error in the JSDoc that also prevents VSCode from showing the correct information. See screenshot below
![image](https://github.com/redwoodjs/redwood/assets/30793/8f1debf5-295a-4f82-9b13-c072236d0393)

And with the fix:
![image](https://github.com/redwoodjs/redwood/assets/30793/bebf2c6f-0d45-42e1-9bfe-e67f07fccad6)
Expand Up @@ -57,7 +57,7 @@ exports[`Single word default files > creates a single word function file 1`] = `
* @typedef { import('aws-lambda').APIGatewayEvent } APIGatewayEvent
* @typedef { import('aws-lambda').Context } Context
* @param { APIGatewayEvent } event - an object which contains information from the invoker.
* @param { Context } context - contains information about the invocation,
* @param { Context } _context - contains information about the invocation,
* function, and execution environment.
*/
export const handler = async (event, _context) => {
Expand Down Expand Up @@ -92,7 +92,7 @@ exports[`creates a .js file if --javascript=true 1`] = `
* @typedef { import('aws-lambda').APIGatewayEvent } APIGatewayEvent
* @typedef { import('aws-lambda').Context } Context
* @param { APIGatewayEvent } event - an object which contains information from the invoker.
* @param { Context } context - contains information about the invocation,
* @param { Context } _context - contains information about the invocation,
* function, and execution environment.
*/
export const handler = async (event, _context) => {
Expand Down Expand Up @@ -129,7 +129,7 @@ import { logger } from 'src/lib/logger'
* @typedef { import('aws-lambda').APIGatewayEvent } APIGatewayEvent
* @typedef { import('aws-lambda').Context } Context
* @param { APIGatewayEvent } event - an object which contains information from the invoker.
* @param { Context } context - contains information about the invocation,
* @param { Context } _context - contains information about the invocation,
* function, and execution environment.
*/
export const handler = async (event: APIGatewayEvent, _context: Context) => {
Expand Down Expand Up @@ -164,7 +164,7 @@ exports[`creates a multi word function file 1`] = `
* @typedef { import('aws-lambda').APIGatewayEvent } APIGatewayEvent
* @typedef { import('aws-lambda').Context } Context
* @param { APIGatewayEvent } event - an object which contains information from the invoker.
* @param { Context } context - contains information about the invocation,
* @param { Context } _context - contains information about the invocation,
* function, and execution environment.
*/
export const handler = async (event, _context) => {
Expand Down
Expand Up @@ -15,7 +15,7 @@ import { logger } from 'src/lib/logger'
* @typedef { import('aws-lambda').APIGatewayEvent } APIGatewayEvent
* @typedef { import('aws-lambda').Context } Context
* @param { APIGatewayEvent } event - an object which contains information from the invoker.
* @param { Context } context - contains information about the invocation,
* @param { Context } _context - contains information about the invocation,
* function, and execution environment.
*/
export const handler = async (event: APIGatewayEvent, _context: Context) => {
Expand Down

0 comments on commit ab9d6cf

Please sign in to comment.