You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<scriptsetuplang="ts">console.log(dummy) // this works</script>
<template>
{{ _.dummy }} this doesn't work
</template>
Describe the bug
When using unplugin-auto-import in a Vite project to automatically import dependencies, the _.isArray function from a file (src/utils/lodash.ts) is working correctly in the script context but fails in the template.
The issue manifests as follows:
In the script section (<script setup>), _.isArray is correctly imported and works as expected.
In the template section (), _.isArray results in unexpected behavior, where the condition does not behave as expected.
Index.vue?t=1706181696036:54 TypeError: (intermediate value)(intermediate value)(intermediate value).isArray is not a function
at Proxy._sfc_render (Index.vue:34:1)
at renderComponentRoot (chunk-Z55UPKXR.js?v=d34c77c8:2318:17)
at ReactiveEffect.componentUpdateFn [as fn] (chunk-Z55UPKXR.js?v=d34c77c8:7535:26)
at ReactiveEffect.run (chunk-Z55UPKXR.js?v=d34c77c8:421:19)
at instance.update (chunk-Z55UPKXR.js?v=d34c77c8:7588:17)
at chunk-Z55UPKXR.js?v=d34c77c8:1923:14
at Array.forEach (<anonymous>)
at rerender (chunk-Z55UPKXR.js?v=d34c77c8:1915:25)
at Object.rerender (chunk-Z55UPKXR.js?v=d34c77c8:1981:14)
at Index.vue?t=1706181696036:54:25
Note
Describe the bug
When using unplugin-auto-import in a Vite project to automatically import dependencies, the
_.isArray
function from a file(src/utils/lodash.ts)
is working correctly in the script context but fails in the template.The issue manifests as follows:
In the script section (<script setup>), _.isArray is correctly imported and works as expected.
In the template section (),
_.isArray
results in unexpected behavior, where the condition does not behave as expected.Folder Structure:
vite.config.ts
Reproduction
N/A
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: