-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
catch broken links #1727
Comments
👍
|
After getting the basics going, I face a conceptual problem. There is no way to report errors in a standardized way. The build is split in a bootstrap phase and a webpack based build phase. The webpack build uses the friendly-webpack-error-plugin to format error messages, clear the console and print webpack status information. So for the usecase of catching and reporting broken links, there would be two strategies of reporting the problems. My personal preferred way would be to introduce the error boundaries. So please let me know what you think. |
I'm not entirely sure what you mean by "error boundaries" but it sounds intriguing :-) @jquense is actually disabling friendly-webpack-plugin in #1746 as like you said, it clears all the errors from the bootstrap which hasn't been ideal. Would love to hear more of your thoughts on how this could work! I'd definitely agree that the current error/warning story isn't great. |
I'm hoping eventually we can use our own webpack error reporting system. or at least customize the FWE plugin a bit more. I bet they would open contributions so I might take that route. I'd love to get all the webpack stuff running through the same reporter as the rest of Gatsby |
@jquense nice work! I will try to rebase my work onto your PR. |
@johann-sonntagbauer or anyone else, this would be great to add still! |
@KyleAMathews sorry forgot about that one. Will try to find some time to consolidate with the work @jquense did. It should make the error reporting much smoother. |
Following up on this — is there a WIP anywhere that we can pick up, @johann-sonntagbauer? (No pressure, I just really want this feature. 😂) Also, it looks like this is only catching links at the same origin. Is there any issue open to check all links? I didn't find one in my search. I imagine that won't be very performant, so maybe it would make more sense as a plugin so it's an opt-in thing. (Let me know if that seems like the right idea and I'll open a separate issue for the plugin dev.) |
@jlengstorf this work is currently only checking same origin links. Hope to bring it to a somehow useable state. |
Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open! |
This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue. |
Maybe a plugin that uses the programatic interface of https://www.npmjs.com/package/broken-link-checker ? Any interest? |
@ivanoats I'd love to see that — let me know if you get one rolling and I'll happily help you test it. |
It would be great to have some feedback if internal links are reachable or not.
At least for Markdown files it would be doable to analyse the links and check if there are pages registered in the system. If not, a meaningfull error message with some context would be great.
example.md
error message
I started a simple proof of concept for that, but need some support on how to access the internal data structures in the right way. So please if the idea is valid I could finalize a PR for that feature.
The text was updated successfully, but these errors were encountered: