Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
notsql opened this issue Jul 2, 2023 · 2 comments · May be fixed by #408
Closed
2 tasks done

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

notsql opened this issue Jul 2, 2023 · 2 comments · May be fixed by #408

Comments

@notsql
Copy link

notsql commented Jul 2, 2023

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

@notsql notsql changed the title Fastify Autoload does not work with Bun.js Fastify Autoload does not work with Bun.js or deno Jul 2, 2023
@Eomm
Copy link
Member

Eomm commented Jul 2, 2023

Bun is not a target runtime right now

ref: https://github.com/fastify/fastify/blob/main/docs/Reference/LTS.md
Related: fastify/fastify#2173

@Uzlopak
Copy link
Contributor

Uzlopak commented Jul 2, 2023

It seems to be an issue in pino. But to be honest, if you want to use bun or deno, than you should investigate deeper and provide PRs to get things compatible.

@mcollina mcollina closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants