wxt
wxt copied to clipboard
feat: tolerate module resolution errors on startup
Overview
Avoid crashing the dev server if a broken import exists.
Unrelated to this PR: You can see the suggestion to install vite-tsconfig-paths, but as I understand it, WXT doesn't recommend using that package; preferring that the user sets alias in wxt.config.ts instead.
Manual Testing
- Introduce a broken
importstatement - Start the dev server
Deploy Preview for creative-fairy-df92c4 ready!
| Name | Link |
|---|---|
| Latest commit | fdd9eb3b7dbfe56e5b55208b3b15c4e01f006593 |
| Latest deploy log | https://app.netlify.com/sites/creative-fairy-df92c4/deploys/67f56bc0cd7ac20008be8d69 |
| Deploy Preview | https://deploy-preview-1529--creative-fairy-df92c4.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Do not merge yet. Looking into import errors coming from Vite's load fallback...
~~Still not ready. Handling the Rollup failed to resolve import error now!~~
Okay, should be ready for review! @aklinker1
@aklinker1 I updated existing tests for detectDevChanges. I wasn't sure what the test for the new errorFiles argument should look like, so I created a stub for you to fill out.
And we should definintely add tests for this function (
resolveErrorFiles). Will be nice to have example errors we can refer to to understand what exactly what is happening better.
Do you mean unit tests with dummy errors resembling real ones, or are you asking for integration tests that reproduce the errors using Babel, Rollup, Vite, etc?
Do you mean unit tests with dummy errors resembling real ones, or are you asking for integration tests that reproduce the errors using Babel, Rollup, Vite, etc?
I was just taking about unit tests, but integration tests would probably be better for this.