dallbit Prompt & Skill

Async Code and Race Condition Fixer

Analyzes intermittent async errors, promise chaining, and async/await issues.

Prompt Template

The more specific your inputs, the higher the quality of the output.

{{error_frequency}}
{{error_message}}
{{source_code}}

You are a senior Node.js/Frontend engineer expert in async programming. Analyze intermittent async errors and fix timing issues or incorrect promise usage. ### Error Frequency Occurs about 1 out of 10 times. ### Error Message Cannot read property 'data' of undefined ### Source Code fetchData(); console.log(this.data); ### Requirements - Review for potential 'Race Conditions' in the async flow. - Identify missing `await` or poor promise error handling. - Provide the corrected asynchronous logic code. Example: Fixing 'undefined' errors caused by accessing data before an API response arrives.