question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

validation system false positive on URL with `#`

See original GitHub issue

🐛 Bug Report

Validation has false positive on URLs with # in the URL

Have you read the [Contributing Guidelines on issues]

yes

To Reproduce

  1. Create a link definition in docusaurus.config.js as follows:
   footer: {
      links: [ 
        {
          title: 'Docs', 
          items: [
            {
              href: 'https://riot.im/app/#/room/#ligo-public:matrix.org',
              label: 'Riot'
            }
	  ]
	}
    }
  1. run npm run build

Expected behaviour

Build should complete without error

Actual Behavior

We get an error:

Creating an optimized production build...

A validation error occured.
The validation system was added recently to Docusaurus as an attempt to avoid user configuration errors.
We may have made some mistakes.
If you think your configuration is valid and should keep working, please open a bug report.

ValidationError: "footer.links[1].items[3].href" must be a valid uri

Your Environment

"@docusaurus/core": "^2.0.0-alpha.61"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
anshulrgoyalcommented, Aug 5, 2020

we can add a Joi.custom() and check if url.parse work on the given url or not.

1reaction
slorbercommented, Aug 5, 2020

The end result here is that the new docusarus validation breaks links that we have had in place for a long time.

Sorry for that. Also worth considering that before that we didn’t do any validation, so you could pass any invalid URL as well. We don’t really want to revert these validation logic.


I’ve opened an issue on Joi because I think if new URL() can parse your URL then Joi should rather accept it (I guess?).

https://github.com/sideway/joi/issues/2435


@anshulrgoyal @teikjun as you are familiar with the validation system, what about adding something like Joi.alternatives(Joi.string().uri(),parseableUrlSchema()) or something, with parseableUrlSchema not rejecting if new URL() is ok?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Validate & Analyse False Positive Alerts from your EDR - VMRay
Learn how VMRay Analyzer helps security teams easily validate false positive alerts from endpoint detection and response systems.
Read more >
Address false positives/negatives in Microsoft Defender for ...
Learn how to handle false positives or false negatives in ... See Configure and validate exclusions for Microsoft Defender Antivirus scans.
Read more >
Intrusion Detection - OWASP Foundation
A false positive is a false alarm. A false negative state is the most serious and dangerous state. This is when the IDS...
Read more >
Vulnerability scans and false positives: the importance of ...
The scanner identifies an input field, which it tests to see if a blind injection attack is possible, inserting input that contains a...
Read more >
False Positive Check - Dotcom-Monitor
The false-positive check helps to eliminate potentially false errors when there may have been a brief hiccup or network glitch that caused a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found