Skip to content

fastify not found, proceeding anyway if running ES module Node.js program #101

@coreyfarrell

Description

@coreyfarrell

💥 Regression Report

Loading plugins which use fastify-plugin produces a warning message when running a native ES module program.

Last working version

Worked up to version: 2.0.2

Stopped working in version: 2.0.3

To Reproduce

Steps to reproduce the behavior:

Install latest fastify and fastify-static, run the following script.mjs (tested in Node.js 14.8.0):

// script.mjs
import fastifyStatic from 'fastify-static';

Expected behavior

fastify-static should validate the expected version of fastify is installed, nothing should display. Instead it prints:

fastify not found, proceeding anyway

Adding a printout of the exception shows TypeError: Cannot read property 'filename' of undefined.

Your Environment

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