20 of the best prompts for resolve module system conflicts, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
20 of the best prompts for resolve module system conflicts, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
Published July 2, 2026
Most people try to use AI for Resolve Module System Conflicts with a single vague prompt and get generic results. This guide takes a different approach: 4 targeted stages, from Diagnose the Wall through Prevent Recurrence, each with a prompt that gives the AI exactly the context it needs. Mixing CommonJS require and ES module import/export can lead to silent failures in your application. If not addressed, it may cause broken functionality and hinder feature development. By following this guide, you will ensure a consistent module system, improving code reliability and maintainability. Works with ChatGPT, Claude, and Gemini.
Check for errors related to module imports and exports in your console or build output. Look specifically for messages indicating conflicts between CommonJS and ES modules.
Quote the Module System Error
Please provide the exact error message related to module imports or exports that you received in the console. Indicate if the message specifically mentions CommonJS or ES modules. Additionally, summarize any relevant context about when the error occurred, such as the code you were trying to run or the specific actions that led to the error. Format your response in a clear, structured manner for easy understanding.
Paste the Build Error
Please analyze the following build error output for module system conflicts: [ERROR OUTPUT]. Identify the specific issues causing the conflict and provide a detailed explanation of the root cause. Additionally, suggest potential solutions or workarounds to resolve the issue effectively. Format your response as a structured report with clear headings for each section.
State Your Understanding of the Instruction
Please summarize your understanding of the instruction regarding the module system usage in the context of the bolt-wrong-module-system. Include key points such as the intended functionality, any specific requirements or constraints mentioned, and potential areas of confusion that may need clarification. Format your response as a structured outline with bullet points for clarity.
Expected vs. Actual Module Behavior
Compare the expected behavior of module imports and exports in the [MODULE SYSTEM] with the actual behavior currently observed. Clearly outline the correct module system's specifications, including how imports and exports should function. Then, detail the discrepancies between the expected and actual behavior, providing examples of each to illustrate the differences. Format your response in a table for clarity, with columns for "Expected Behavior," "Actual Behavior," and "Examples.
Identify the Violated Module Rule
Identify and quote the specific rule or constraint regarding module imports and exports that has been violated in the following code snippet: [CODE SNIPPET]. Explain how this violation affects the functionality of the code and suggest a solution to resolve the conflict. Format your response in a clear and structured manner, outlining the rule, the violation, and the proposed fix.
Target the specific files or lines where the module system conflict occurs. Focus on correcting the imports and exports to ensure consistency.
Correct Import Syntax
Identify the file that contains an import statement using CommonJS syntax. Convert this import statement to use ES module syntax instead. Provide a detailed comparison by showing the differences between the old CommonJS import and the new ES module import in a clear diff format.
Rewrite Export Statements
Identify the file containing export statements that mix module systems. Rewrite these statements to ensure they all use a consistent ES module export format. Please provide both the original code snippets and the revised versions, clearly labeled as "Before" and "After.
Scoped Change for Module Imports
Identify a specific function in the code that uses the wrong module import style. Change only that function to use the correct ES module import syntax. Please provide the modified code along with a brief explanation of the changes made and why the new import style is preferred.
Enforce Module Format Consistency
Review the entire codebase for the use of mixed module formats. Identify all files that do not conform to ES module syntax and create a detailed checklist of these files. Additionally, provide specific recommendations for updating each file to ensure consistency in module format across the codebase.
Update Dependencies for Compatibility
Identify the dependencies in the [PROJECT NAME] that require CommonJS compatibility. Provide a detailed list of these dependencies along with their current versions and the recommended updates to ensure compatibility with ES modules. Additionally, explain the potential issues that may arise from not updating these dependencies and suggest a timeline for implementing these changes.
Confirm that the module system conflict has been resolved by checking the build output and functionality. Look for any remaining errors.
Run a Build Test
Please execute the build command for the [PROJECT NAME] to verify the module system. Ensure that the output confirms a successful build, free from any warnings or errors. After running the test, provide a summary of the results, including any relevant logs or messages that may indicate issues or confirm success.
Show Diff of Changes Made
Please display the diff of the files where changes were made to correct the module system for the use-case 'bolt-wrong-module-system'. Ensure that the output clearly highlights the modifications and reflects a consistent module format. Include a brief explanation of each change and why it was necessary for maintaining consistency.
Replay the Original Failing Scenario
Re-run the original scenario that caused the module system conflict in the [APPLICATION NAME]. Verify that the scenario executes successfully without any errors related to module imports or exports. Provide a detailed report of the results, including any error messages encountered previously and confirm their resolution.
Check Edge Cases for Module Imports
Please test the edge cases in the application related to module imports. Identify any scenarios that may lead to module-related errors, and provide a detailed report on whether these edge cases function correctly. Include examples of the edge cases tested, the results of each test, and any recommendations for improvements if errors are found.
Confirm Output State of Key Files
Verify the output state of the key files affected by the module system changes for the use-case: [USE-CASE NAME]. Please check that each file now reflects the correct module format and functionality. Provide a detailed report listing any discrepancies found, along with suggestions for correcting them, and ensure the report is structured with sections for each file reviewed.
Establish reusable artefacts that help prevent future module system conflicts in Bolt. Focus on consistent module usage.
Module System Consistency Check Prompt
Before executing any code, please verify that all module imports and exports in the provided code snippet are consistently using ES module syntax. If you detect any discrepancies, halt execution and provide a detailed report of the issues found, including the specific lines of code where the inconsistencies occur. Format the output as a list of discrepancies with explanations for each.
Module Import Guidelines Template
Create a conversation-starter template for discussing module import guidelines. The template should include the following points: first, explain the importance of using ES module syntax for all imports. Second, provide a clear instruction on what to do if CommonJS is encountered, emphasizing the need for immediate conversion to ES module syntax. Format this template as a checklist that can be used during code reviews or team discussions.
Project Spec for Module Usage
Draft a project specification message regarding module usage for the project titled [PROJECT NAME]. Clearly state that all modules must adhere to ES module syntax exclusively. Specify that any instances of CommonJS will necessitate a review and refactor process, and outline the steps for how this review will be conducted. Include a timeline for compliance and any resources available for team members to assist with the transition.
Naming Convention for Module Files
Please create a detailed naming convention guideline for module files in the context of the 'bolt-wrong-module-system'. Specify that all module files should be suffixed with '.mjs' to indicate they use ES module syntax. Include the rationale behind this convention, how it helps prevent mixing module types, and any additional best practices for naming files in this system. Format the output as a structured document with headings for each section.
Self-Check Request for Module Imports
Please create a self-check request for the module imports in the codebase. Before each deployment, the system should run a check to ensure that no CommonJS syntax is present. If any CommonJS syntax is found, generate a detailed report of the findings, including the specific locations and lines of code where the syntax occurs, so that necessary corrections can be made promptly.
Mixing module systems can lead to silent failures during execution, as Bolt may not surface the underlying issues. This can result in broken features and unexpected behavior.
You can identify conflicts by checking the console for error messages that indicate issues with module imports or exports. Bolt's build output will also highlight these errors.
You need to update your imports to use a consistent module syntax. Bolt requires either all CommonJS or all ES module syntax to function correctly.
No, Bolt does not support mixing CommonJS and ES modules within the same codebase. This can lead to unpredictable behavior and errors.
Establish project guidelines that enforce the use of ES module syntax. Regularly review your codebase to catch any instances of CommonJS syntax before they cause issues.
AI Prompts for Resolving Mixed Module Systems
Mixing CommonJS require and ES module import/export can lead to unexpected errors and failed builds.
See promptsAI Prompts for Resolving Module System Conflicts
Mixing CommonJS and ES module systems leads to runtime errors and inconsistent behavior.
See promptsAI Prompts for Resolving Module System Conflicts
Mixing CommonJS require and ES module import/export in the same codebase leads to runtime errors and unexpected behavior.
See prompts