10000 Add feature to report a bug with Hot Reload · Issue #3299 · dart-lang/dart-pad · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add feature to report a bug with Hot Reload #3299

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

Open
johnpryan opened this issue May 14, 2025 · 1 comment
Open

Add feature to report a bug with Hot Reload #3299

johnpryan opened this issue May 14, 2025 · 1 comment
Assignees
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug

Comments

@johnpryan
Copy link
Contributor
johnpryan commented May 14, 2025

When there's a DDC error that could have been caused by a Hot Reload, we should provide a link to open a dart-pad issue with the stack trace.

cc: @kevmoo @natebiggs

@johnpryan
Copy link
Contributor Author
johnpryan commented May 14, 2025

Example code: (generated with Gemini)

import 'dart:convert'; // Required for Uri.encodeComponent

void main() {
  // --- Configuration for your GitHub repository ---
  // Replace with your GitHub username or organization
  const String repoOwner = 'octocat';
  // Replace with your repository name
  const String repoName = 'Spoon-Knife';

  // --- Issue details ---
  const String issueTitle = 'Bug: Application crashed with an error';

  // A dummy stack trace for demonstration purposes.
  // In a real application, you would capture the actual stack trace.
  const String dummyStackTrace = '''
Error: Something went wrong!
    at myFunction (app.js:10:15)
    at anotherFunction (app.js:20:20)
    at HTMLButtonElement.onClick (index.html:35:10)
    at EventTarget.dispatchEvent (event.js:123:45)
    at Object.invokeGuardedCallbackProd (react-dom.production.min.js:145:10)
    at invokeGuardedCallback (react-dom.development.js:2375:14)
    at batchedUpdates\$1 (react-dom.development.js:2391:16)
    at Object.batchedUpdates (react-dom.development.js:2407:12)
    at dispatchEvent (react-dom.development.js:5272:14)
    at HTMLDivElement.handleEvent (react-dom.development.js:5315:10)
''';

  // Construct the issue body with Markdown formatting.
  // Each line break (\n) and special character needs to be handled
  // when encoding for a URL.
  final String issueBody = '''
### Description

The application encountered an unexpected error.

### Steps to Reproduce

1. (Describe step 1)
2. (Describe step 2)
3. (Describe step 3)

### Expected Behavior

The application should not crash.

### Actual Behavior

The application crashed and displayed an error.

### Stack Trace

```
${dummyStackTrace}
```

### Environment

- Browser: (e.g., Chrome 120, Firefox 121)
- OS: (e.g., Windows 10, macOS Sonoma, Android 14)
- App Version: (e.g., 1.0.0)
''';

  // Optional: Add labels, assignees, milestone
  const String labels = 'bug, critical'; // Comma-separated labels
  const String assignees = 'your-github-username'; // GitHub username
  const String milestone = 'v1.1'; // Milestone title

  // Encode all components for the URL.
  // Uri.encodeComponent handles spaces and special characters correctly.
  final String encodedIssueTitle = Uri.encodeComponent(issueTitle);
  final String encodedIssueBody = Uri.encodeComponent(issueBody);
  final String encodedLabels = Uri.encodeComponent(labels);
  final String encodedAssignees = Uri.encodeComponent(assignees);
  final String encodedMilestone = Uri.encodeComponent(milestone);

  // Construct the GitHub issue URL.
  // The 'new' endpoint is used for creating new issues.
  // Parameters:
  //   - title: The title of the issue.
  //   - body: The main content of the issue, supports Markdown.
  //   - labels: Comma-separated list of labels.
  //   - assignees: Comma-separated list of assignees (GitHub usernames).
  //   - milestone: The title of the milestone.
  final String githubIssueUrl =
      'https://github.com/$repoOwner/$repoName/issues/new?'
      'title=$encodedIssueTitle'
      '&body=$encodedIssueBody'
      '&labels=$encodedLabels'
      '&assignees=$encodedAssignees'
      '&milestone=$encodedMilestone';

  // Print the generated URL to the console.
  print('Generated GitHub Issue URL:');
  print(githubIssueUrl);
}

@johnpryan johnpryan self-assigned this May 14, 2025
@johnpryan johnpryan added P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug labels May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

1 participant
0