-
-
Notifications
You must be signed in to change notification settings - Fork 9.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
Nextjs: Improve Google Fonts failure error messages and documentation #23891
Nextjs: Improve Google Fonts failure error messages and documentation #23891
Conversation
Helpful for debugging which fonts need to be mocked related: storybookjs#23332
Co-authored-by: Yann Braga <yannbf@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nsheaps thanks for addressing the feedback so promptly. Appreciate it 🙏 ! Documentation-wise it's all good on my end. I'll defer to the other maintainers and see what they have to say about it.
Hope you have a great day.
Stay safe
I see some opportunity to use the categorized errors framework here, so leave it to me and I'll update this branch soon and merge it! |
code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts
Outdated
Show resolved
Hide resolved
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: @types/prompts@2.4.4, file-system-cache@2.3.0, magic-string@0.27.0, safe-identifier@0.4.2, window-size@1.1.1 |
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is new author?A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package. Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights. What is shell access?This module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code. Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
Helpful for debugging which fonts need to be mocked
related: #23332
What I did
Made the error message (which I saw typically thrown during chromatic builds) useful by including the original error in the newly thrown error, which makes the mocking tasks way easier.
Documentation also added for mocking (which is really part of nextjs but no documentation exists)
How to test
Tested by manually adding these changes in minified code when testing mocked font responses for use with chromatic.
Checklist
MIGRATION.MD
Maintainers
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts
["cleanup", "BREAKING CHANGE", "feature request", "bug", "build", "documentation", "maintenance", "dependencies", "other"]
🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>