Skip to content

Change require "url" to "node:url" did make it incompatible with usage inside browser / web #82

@alexander-schranz

Description

@alexander-schranz

Prerequisites

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

Fastify version

Plugin version

2.3.0

Node.js version

v14.21.3

Operating system

macOS

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

12.7.4

Description

The changes in 6c97e35

seems to break packages which using it as example via webpack in the browser. I'm not 100% sure if this package was created to work inside browser but thought I would report it if it should.

Currently because of node:url the ajv is failing now which is package used for json schema validation in some cases as we in @sulu using it in browser: ajv-validator/ajv#2446

Link to code that reproduces the bug

ajv-validator/ajv#2446

Expected Behavior

Should work inside the browser / web apps compiles with webpack 4 / 5.

Workaround

For all coming from ajv-validator/ajv#2446 you can downgrade ajv to a version not using fast-uri:

npm install "ajv@8.14.*" --save

or downgrade fast-uro to:

npm install "fast-uri@2.2.*" --save

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions