edgedb-js icon indicating copy to clipboard operation
edgedb-js copied to clipboard

`@edgedb/generate` scripts not executing properly with `bun` version 1.1.10

Open mcisne4 opened this issue 1 year ago • 0 comments

When using the latest version of bun (v1.1.10), the bunx @edgedb/generate queries and the bunx @edgedb/generate interfaces scripts do not fully execute. Execution of the scripts starts properly but suddenly terminates after attempting to connect to the database. No errors are emitted, execution just stops. No files are generated as a result.

The above issue is resolved if I roll back to the previous version of bun (v1.1.9).

NOTE: The bunx @edgedb/generate edgeql-js script seems to execute properly. The TypeScript/JS code inside of my app is able to properly connect and communicate with the database.

Error or desired behavior

Executing the queries generation script:

# [Bun v1.1.10]
# Improper Execution:
> bunx @edgedb/generate queries
Generating functions from .edgeql files...
Detected tsconfig.json, generating TypeScript files.
   To override this, use the --target flag.
   Run `npx @edgedb/generate --help` for full options.
Detected project root via edgedb.toml:
   /home/mcisne4/dev/bun/experiment-26
Detected schema directory: dbschema
Connecting to database...
# [Bun v1.1.9]
# Proper Execution:
> bunx @edgedb/generate queries
Generating functions from .edgeql files...
Detected tsconfig.json, generating TypeScript files.
   To override this, use the --target flag.
   Run `npx @edgedb/generate --help` for full options.
Detected project root via edgedb.toml:
   /home/mcisne4/dev/bun/experiment-26
Detected schema directory: dbschema
Connecting to database...
Analyzing .edgeql files...
Generating files for following queries:
   ./queries/insertXYZ.query.ts

Executing the interfaces script:

# [Bun v1.1.10]
# Improper Execution:
> bunx @edgedb/generate interfaces
Generating TS interfaces from schema...
Introspecting database schema...
# [Bun v1.1.9]
# Proper Execution:
> bunx @edgedb/generate interfaces
Generating TS interfaces from schema...
Introspecting database schema...
Generating interfaces...
Writing interfaces file...
   ./dbschema/interfaces.ts
Generation complete! 🤘

Versions:

  • OS: Ubuntu 23.10
  • EdgeDB version: 5.4+867a505
  • EdgeDB CLI version: 5.1.0+7c5764f
  • edgedb-js version : 1.5.7
  • @edgedb/generate version: 0.5.3
  • TypeScript version: 5.4.5
  • Bun version: 1.1.10

mcisne4 avatar May 29 '24 22:05 mcisne4