You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 22, 2024. It is now read-only.
- Do you want to request a feature or report a bug?
a bug
- What is the current behavior?
importing this library into a Netlify typescript function causes a fatal runtime error
- If the current behavior is a bug, please provide the steps to reproduce.
Create a file called hello.ts in your functions folder:
import{Handler}from'@netlify/functions';import{NetlifyAPI}from'netlify';consthandler: Handler=async(event,context)=>{constclient=newNetlifyAPI('test')asany;// <-- this is the line that breaks itreturn{statusCode: 200,body: JSON.stringify({message: 'Hello World'}),};};export{handler};
Then run netlify dev and visit that endpoint; you'll get a 500:
TypeError: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received undefined
createRequire (internal/modules/cjs/loader.js:1186:11)
Object.<anonymous> (/home/mfan/projects/acb001-crm/node_modules/netlify/src/open_api.js:5:17)
Module._compile (internal/modules/cjs/loader.js:1085:14)
Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
Module.load (internal/modules/cjs/loader.js:950:32)
Function.Module._load (internal/modules/cjs/loader.js:790:14)
Module.require (internal/modules/cjs/loader.js:974:19)
require (internal/modules/cjs/helpers.js:92:18)
Object.<anonymous> (/home/mfan/projects/acb001-crm/.netlify/functions-serve/hello/hello.js:1:18)
Module._compile (internal/modules/cjs/loader.js:1085:14)
- What is the expected behavior?
The client instantiates
- Please mention your node.js, and operating system version.
Node 14, with:
This seems this bug might not be due to js-client, but to the bundling process done on TypeScript Functions, so I am transferring this to the repository related to it.
- Do you want to request a feature or report a bug?
a bug
- What is the current behavior?
importing this library into a Netlify typescript function causes a fatal runtime error
- If the current behavior is a bug, please provide the steps to reproduce.
Create a file called
hello.ts
in yourfunctions
folder:Then run
netlify dev
and visit that endpoint; you'll get a 500:- What is the expected behavior?
The client instantiates
- Please mention your node.js, and operating system version.
Node 14, with:
The text was updated successfully, but these errors were encountered: