Skip to content
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

fix: catch crash in dev server (fixes #1297) #1441

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

royra
Copy link

@royra royra commented Feb 16, 2025

Fixes #1297.
Catch exception in findEntrypoints when reloading changed files in dev server.

Overview

This fixes a problem where the dev server would crash on syntax errors when reloading changed files. The crash occurs due to an exception in the Babel parser which is invoked for finding the entrypoints. The fix is moving the call to findEntrypoints to the try block, where an exception would be caught - just like the rest of the reload logic.

Manual Testing

I have a project which would crash every few minutes while editing in VSCode. After the fix the crashes are gone and the reload works.

Related Issue

This PR closes #1297

Fixes wxt-dev#1297.
Catch exception in `findEntrypoints` when reloading changed files in dev server.
Copy link

netlify bot commented Feb 16, 2025

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit e9b6600
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/67b18dfebe20f10008e839aa
😎 Deploy Preview https://deploy-preview-1441--creative-fairy-df92c4.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 site configuration.

@aklinker1
Copy link
Collaborator

@aleclarson I know you opened #1437, thoughts on this vs your PR?

@aleclarson
Copy link
Contributor

@aklinker1 This is certainly a simpler solution, though does the error actually get logged? And what does that look like? Also, this PR doesn't handle syntax errors that occur on startup; only afterwards.

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.

Babel Parser crash when there's a syntax error in content script
3 participants