-
-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Labels
⚡️ enhancementimprovement over an existing featureimprovement over an existing feature🔄 data-loadersrelated to Data Loadersrelated to Data Loaders
Description
I followed the steps in the docs on Error Handling and added error: [KnownError]
to my basic loader. When KnownError
is thrown from data loader it's correctly captured and set as the error
of data loader result.
But I also noticed that the following warning is being logged each time known error is thrown. Warning is only logged in development.
Loader "undefined"'s "commit()" was called but there is no staged data.
commit @ basic.js:87
(anonymous) @ index.js:95
(anonymous) @ vue-router.mjs:3475
runWithContext @ runtime-core.esm-bundler.js:4024
runWithContext @ vue-router.mjs:3387
(anonymous) @ vue-router.mjs:3475
triggerAfterEach @ vue-router.mjs:3475
(anonymous) @ vue-router.mjs:3370
Promise.then
pushWithRedirect @ vue-router.mjs:3335
push @ vue-router.mjs:3260
navigate @ vue-router.mjs:2315
callWithErrorHandling @ runtime-core.esm-bundler.js:199
callWithAsyncErrorHandling @ runtime-core.esm-bundler.js:206
invoker @ runtime-dom.esm-bundler.js:730
Everything seems to be working well but wasn't sure if this warning is relevant or can be safely ignored?
Minimal repro: https://github.com/romansp/uvr-data-loader-known-errors
Repro steps
- Clone the repo.
pnpm install
pnpm run dev
- Go to the app.
- Open browser console.
- Click the links below to trigger navigation and load data.
Expected
Clicking "Load data with known error" should display KnownError
on the page. No warning in the console.
Actual
Clicking "Load data with known error" logs a warning in the console.
Metadata
Metadata
Assignees
Labels
⚡️ enhancementimprovement over an existing featureimprovement over an existing feature🔄 data-loadersrelated to Data Loadersrelated to Data Loaders