Skip to content

troubleshooting guide#2688

Open
leofelix077 wants to merge 2 commits intofeature/freighter-best-practices-skillfrom
feature/troubleshooting-guide
Open

troubleshooting guide#2688
leofelix077 wants to merge 2 commits intofeature/freighter-best-practices-skillfrom
feature/troubleshooting-guide

Conversation

@leofelix077
Copy link
Copy Markdown
Collaborator

@leofelix077 leofelix077 commented Apr 9, 2026

No description provided.

- Remove Node version mismatch section (covered by quick-start + CONTRIBUTING)
- Remove Playwright browser not found (e2e README prerequisite)
- Remove snapshot tests section (covered by e2e README)
- Remove stale Node 22/Node 20 CI contradiction (engines requires >=22)
- Fix Webpack/Tailwind section header structure after CI section removal
@leofelix077 leofelix077 self-assigned this Apr 9, 2026
Copilot AI review requested due to automatic review settings April 9, 2026 21:00
@leofelix077 leofelix077 changed the title fix(troubleshooting): cross-check cleanup and accuracy fixes troubleshooting guide Apr 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the developer troubleshooting documentation for the Freighter extension and links it from the repo’s agent/index guidance so contributors (and internal agents) have a single reference for common setup/build/test pitfalls.

Changes:

  • Add/refresh a comprehensive troubleshooting guide covering setup, build, testing, CI, MV3, and React 19 topics.
  • Add the troubleshooting guide as an entry point in AGENTS.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
docs/docs/troubleshooting-guide.md Adds/updates the troubleshooting guide content for common dev issues across setup/build/tests/MV3.
AGENTS.md Adds a “Troubleshooting” entry pointing to the new guide.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +5
# N10 — Troubleshooting Guide: Freighter Extension

_Last updated: 2026-04-08_

Common issues and solutions when developing the Freighter browser extension.
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc page doesn’t include the Docusaurus frontmatter block (id/title/slug). In this repo, docs pages consistently use frontmatter, and relying on an inline “# …” title (plus the “N10 —” prefix) can lead to inconsistent routing/title handling and makes it harder to add it to sidebars later. Consider adding frontmatter (and moving the title there) for consistency with the rest of docs.

Copilot uses AI. Check for mistakes.

1. **Reduce parallelism:** Limit Playwright workers in `playwright.config.ts`:
```ts
workers: 1; // or 2, depending on available RAM
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Playwright config snippet uses workers: 1; which is not valid object-literal syntax in TS/JS config files (it should be a comma-separated property). As written, readers copying this into playwright.config.ts will get a syntax error.

Suggested change
workers: 1; // or 2, depending on available RAM
workers: 1, // or 2, depending on available RAM

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +65
### IDE and ESLint plugins not loading with Husky

**Symptom:** Pre-commit hooks run successfully but ESLint errors are not caught
in the editor, or the hook exits early without running ESLint.

**Solution:** Ensure the ESLint VSCode/IDE extension is installed and
configured:

1. **VS Code:** Install the
[ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint).
This project uses ESLint flat config (`eslint.config.js`) — check your
extension version is ≥3.0.10 (flat config support).
2. **WebStorm/IntelliJ:** Enable ESLint under Languages & Frameworks >
JavaScript
> Code Quality Tools > ESLint, and set "Automatic ESLint configuration".
3. **Verify the extension sees the config:** Run ESLint manually to confirm it
picks up the project config before relying on IDE integration:
```bash
npx eslint extension/src/popup/App.tsx
```
4. **After confirming ESLint works**, verify Husky's pre-commit script is
executable:
```bash
ls -la .husky/pre-commit # Should show -rwxr-xr-x
chmod +x .husky/pre-commit # Fix if not executable
```
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section suggests the pre-commit hook runs (or should run) ESLint, but the repo’s .husky/pre-commit currently runs translations + pretty-quick only (no eslint/lint-staged). Please adjust the troubleshooting text so it matches the actual hook behavior (or explicitly call out that ESLint is editor/CI-only unless you wire lint-staged into the hook).

Copilot uses AI. Check for mistakes.
Comment on lines +310 to +311
- Use `chrome.alarms` for delayed operations instead
- Store pending state in `chrome.storage` so it survives worker restarts
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this repo, extension code uses webextension-polyfill (browser.*) and storage wrappers (dataStorageAccess / browserLocalStorage) rather than direct chrome.storage / chrome.alarms. Using chrome.* here is likely to push contributors toward patterns the codebase avoids; consider updating these bullets to reference browser.alarms and the storage helper(s), or note the preferred abstraction.

Suggested change
- Use `chrome.alarms` for delayed operations instead
- Store pending state in `chrome.storage` so it survives worker restarts
- Use `browser.alarms` for delayed operations instead
- Store pending state with the repo's storage helpers (`dataStorageAccess` /
`browserLocalStorage`) so it survives worker restarts

Copilot uses AI. Check for mistakes.
Comment on lines +326 to +336
```typescript
// WRONG — listener may not be registered after worker restart
async function setup() {
const config = await loadConfig();
chrome.runtime.onMessage.addListener(handler);
}

// RIGHT — listener is always registered
chrome.runtime.onMessage.addListener(handler);
```

Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor consistency: the fenced code block language is typescript here, but elsewhere the doc uses ts. Not a blocker, but consider using one consistently to keep syntax highlighting predictable across the docs site.

Copilot uses AI. Check for mistakes.

### Playwright tests fail on stale build

**Symptom:** E2e tests fail with unexpected behavior, missing elements, or
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Symptom:** E2e tests fail with unexpected behavior, missing elements, or
**Symptom:** e2e tests fail with unexpected behavior, missing elements, or

4. Tests that fail consistently across multiple runs are real failures; tests
that pass on retry are flaky

This avoids wasting time debugging timing-related flakes. If a test is
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move away from this advice and move towards using Playwright's playwright-test MCP server to solve flakey tests. The MCP will often put in a more scalable fix than just increasing timeouts, which is often a band aid

`yarn build:extension:translations` and stages locale files. These are generated
— commit them as-is.

## Playwright & CI Compatibility Issues
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think let's group all the Playwright related stuff together

the typed message enums in all three contexts. A mismatch causes silent message
drops.

### Forgetting to test both Manifest V3 contexts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused by what this title means. What are the 2 v3 contexts that this referring to? Is this the DOM and the service worker?


Background scripts run as service workers (Manifest V3), which means:

- No persistent state between events (use `chrome.storage`)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, one common pitfall we can document: we should always use browser.storage rather than th API chrome to maintain cross-browser compatibility

**Solution:** If a ref callback doesn't need cleanup, ensure it returns
`undefined` (or nothing).

## Known Issues & Recent Fixes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is useful today, but we should think about how we can keep this section updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants