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
// file foo.tsimport{NetlifyAPI}from'netlify';try{constclient=newNetlifyAPI("my-token");console.log('Client created successfully');}catch(error){console.error('Error creating Netlify client:',error);}
I get the following error
bun run foo.ts
1 | import omit from 'omit.js';
2 | import { openApiSpec } from './open_api.js';
3 | // Retrieve all OpenAPI operations
4 |export const getOperations = function() {
5 |return Object.entries(openApiSpec.paths).flatMap(([path, pathItem]) => {6 | const operations = omit.default(pathItem, ['parameters']); ^TypeError: omit.default is not a function. (In 'omit.default(pathItem, ["parameters"])', 'omit.default' is undefined) at /[redacted]/node_modules/netlify/lib/operations.js:6:28 at /[redacted]/node_modules/netlify/lib/index.js:87:24
Steps to reproduce
Create new file foo.ts
Add dependency via bun with bun add netlify
paste content provided above in the file
execute with bun run foo.ts
Configuration
Deploy logs
The text was updated successfully, but these errors were encountered:
@pachico if this works in Node, then it's a bug in Bun and not in Netlify.
Without reading omit.js's code, my guess is Bun is respecting __esModule on omit.js when converting to ESM, so omit.default is undefined since that's the equivalent of require("omit.js").default.default and that would cause the error "omit.default" is not a function
Describe the bug
When I try to create a client with these lines:
I get the following error
Steps to reproduce
foo.ts
bun add netlify
bun run foo.ts
Configuration
Deploy logs
The text was updated successfully, but these errors were encountered: