Skip to content
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

chore(docs): add a troubleshooting section #268

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ Finally, in case you are using banners and want to have further control on the a
</div>
```

# Troubleshooting

## I see `Uncaught Error: Mismatched anonymous define() module` in the browser console

You are most likely running into issues with how the library is loaded. This is a common issue with RequireJS and other AMD loaders. The library is not AMD compatible, so you need to load it as a global script.

Another approach is to use the ESM version of the library, which you can either import directly should you import the library as part of your distribution; or use the published version called `ts.mjs`: `https://unpkg.com/@topsort/[email protected]/dist/ts.mjs`.

# E2E tests

Execute `npm run test:e2e`, at the end it will show you the url you need to visit to test the library.
Expand Down
4 changes: 2 additions & 2 deletions src/queue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Store, MemoryStore, LocalStorageStore } from "./store";
import { type Store, MemoryStore, LocalStorageStore } from "./store";

const STORAGE_TEST_KEY = "ts-t";
const STORAGE_KEY = "ts-q";
Expand Down Expand Up @@ -51,7 +51,7 @@ function expBackoff(startTime: number, retries: number): number {
* Probes the different store implementations looking for one that works in the current browser.
*
* To do so, it checks {@link LocalStorageStore} is actually functional by adding a dummy object and
* checking the retrived result is the same.
* checking the retrieved result is the same.
*
* Note: there's nothing special about the id, but it need to be ideally a length one string, in
* order to minimize the JS library size.
Expand Down