Skip to content

Commit c511082

Browse files
committed
fix: remove wrong error log during HMR
During dev if you edit a component that exports a loader, it will automatically trigger without the navigation. It will therefore have no entry. The loader should account for this and still work.
1 parent 8b3e1f0 commit c511082

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

src/data-loaders/defineColadaLoader.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,6 @@ export function defineColadaLoader<Data, isLazy extends boolean>(
339339
>
340340
let entry = entries.get(loader)
341341

342-
if (process.env.NODE_ENV === 'development') {
343-
if (!parentEntry && !entry) {
344-
console.error(
345-
`Some "useDataLoader()" was called outside of a component's setup or a data loader.`
346-
)
347-
}
348-
}
349-
350342
if (
351343
// if the entry doesn't exist, create it with load and ensure it's loading
352344
!entry ||

src/data-loaders/defineLoader.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,6 @@ export function defineBasicLoader<Data, isLazy extends boolean>(
294294
// console.log('is same route', entry?.pendingTo === route)
295295
// console.log('-- END --')
296296

297-
if (process.env.NODE_ENV === 'development') {
298-
if (!parentEntry && !entry) {
299-
console.error(
300-
`Some "useDataLoader()" was called outside of a component's setup or a data loader.`
301-
)
302-
}
303-
}
304-
305297
if (
306298
// if the entry doesn't exist, create it with load and ensure it's loading
307299
!entry ||

0 commit comments

Comments
 (0)