Skip to content

fix: should show module not found error codeFrame correctly #427

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

Merged
merged 3 commits into from
Jul 31, 2025

Conversation

9aoy
Copy link
Contributor

@9aoy 9aoy commented Jul 30, 2025

Summary

should show module not found error codeFrame correctly.

before:
image

after:
image

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 11:41
Copy link

netlify bot commented Jul 30, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit bdb888e
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/688a0d2aa64d5e00080e7e27
😎 Deploy Preview https://deploy-preview-427--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@Copilot 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

This PR fixes the display of code frames for "module not found" errors by improving error stack trace filtering and adding test coverage to ensure the fix works correctly.

  • Adds webpack runtime paths to the stack trace ignore list to improve error reporting
  • Creates a test fixture that triggers a module not found error scenario
  • Validates that the error message and code frame are displayed correctly

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/core/src/utils/error.ts Adds webpack runtime filter to stack trace ignore list
tests/test-api/fixtures/moduleNotFound.codeFrame.test.ts Test fixture that imports a non-existent module to trigger the error
tests/test-api/edgeCase.test.ts Integration test verifying module not found errors show correct code frames
Comments suppressed due to low confidence (1)

tests/test-api/fixtures/moduleNotFound.codeFrame.test.ts:8

  • [nitpick] The test name 'test expectNotFound error' is inconsistent with the function name 'unexpectNotFound'. Consider renaming to 'test unexpectedNotFound error' or renaming the function to 'expectNotFound' for consistency.
it('test expectNotFound error', async () => {

@9aoy 9aoy merged commit 87edbf3 into main Jul 31, 2025
16 checks passed
@9aoy 9aoy deleted the module-not-found-error branch July 31, 2025 03:52
@9aoy 9aoy mentioned this pull request Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant