PaloAltoNetworks / PaloAltoNetworks/docusaurus-openapi-docs

Wrong ProvidePlugin of URL

Open
#1,096 6 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.1k
Forks
315
Avg merge
7d 5h
Merged PRs (30d)
7

Description

Describe the bug

The PR #1089 introduced ProvidePlugin for 'URL' from 'url', but URL is not included in node url module.

This causes a browser error of Q is not a constructor if any client code includes new URL(...)

Expected behavior

No error with client code new URL(...)

Current behavior

Error in browser

Possible solution

Remove the fallback settings of 'URL'.

Steps to reproduce

Edit: this is not reproducible any more, since they downgraded this plugin to an older version to workaround the issue.

  1. Open https://docs.port.io/
  2. Click the search bar at top-right
  3. An error reported in browser console.

Screenshots

Image

Context

Your Environment

  • Version used: 4.3.5
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3):
  • Operating System and version (desktop or mobile):
  • Link to your project: https://github.com/port-labs/port-docs

Related issue: https://github.com/easyops-cn/docusaurus-search-local/issues/500

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review PR #1089 and the current ProvidePlugin configuration for the URL fallback, including the older plugin version used as a workaround. Verify the behavior with client code using new URL(...) and confirm that the browser error is gone when the incorrect fallback is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.