Skip to content

Fastify Autoload does not work with Bun.js or deno #317

Closed as not planned
@notsql

Description

@notsql

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.7.0

Plugin version

5.7.0

Node.js version

18.16.1

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

38

Description

When using bun to run fastify with the fastify autoload plugin, the code crashes with the following error:

124 |       return join(__dirname, '..', 'file.js')
125 |     }
126 | 
127 |     let fixTarget
128 | 
129 |     for (const filePath of callers) {
                               ^
TypeError: undefined is not an object (evaluating 'callers')
      at fixTarget (/home/notsql/Development/Flora/back-end/node_modules/pino/lib/transport.js:129:27)
      at transport (/home/notsql/Development/Flora/back-end/node_modules/pino/lib/transport.js:114:21)
      at normalizeArgs (/home/notsql/Development/Flora/back-end/node_modules/pino/lib/tools.js:311:15)
      at pino (/home/notsql/Development/Flora/back-end/node_modules/pino/pino.js:87:27)
      at createPinoLogger (/home/notsql/Development/Flora/back-end/node_modules/fastify/lib/logger.js:42:13)
      at createLogger (/home/notsql/Development/Flora/back-end/node_modules/fastify/lib/logger.js:101:17)
      at fastify (/home/notsql/Development/Flora/back-end/node_modules/fastify/fastify.js:137:32)
      at build (/home/notsql/Development/Flora/back-end/src/main.ts:7:14)
      at /home/notsql/Development/Flora/back-end/src/server.ts:7:15

Steps to Reproduce

  1. Setup fastify with fastify autoloader plugin.

  2. Ensure all dependencies are installed

bun install
  1. Run the code
bun run index.ts

Expected Behavior

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions