generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
45 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Multiple versions of the library are loaded | ||
|
||
This error occurs if two different versions of `next-usequerystate` are | ||
loaded in the same application. | ||
|
||
This may happen if you are using a package that embeds next-usequerystate and | ||
you are also using next-usequerystate directly. | ||
|
||
## Possible Solutions | ||
|
||
Inspect your dependencies for duplicate versions of `next-usequerystate` and | ||
use the `resolutions` field in `package.json` to force all dependencies | ||
to use the same version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# URL update rate-limited by the browser | ||
|
||
This error occurs when too many URL updates are attempted in a short period of | ||
time. For example, connecting a query state to a text input that updates on | ||
every keypress, or a slider (`<input type="range">`). | ||
|
||
## Possible Solutions | ||
|
||
The library has a built-in throttling mechanism, that can be configured per | ||
instance. See the [throttling](https://github.com/47ng/next-usequerystate#throttling) | ||
docs for more information. | ||
|
||
## Safari | ||
|
||
Safari has a very low rate-limit on URL updates: 100 updates per 30 seconds (or per 10 seconds on Safari 17 and above). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const errors = { | ||
409: 'Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using %s, but %s was about to load on top.', | ||
429: 'URL update rate-limited by the browser. Consider increasing `throttleMs` for keys %s. %O' | ||
} as const | ||
|
||
export function error(code: keyof typeof errors, ...args: any[]) { | ||
const message = `[next-usequerystate] ${errors[code]} | ||
See https://err.sh/47ng/next-usequerystate/NUQS-${code}` | ||
console.error(message, ...args) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters