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
The node_modules resources imported in vue 2 async components, such as "xxx/foo.css", may refer to a nonexistent "../foo-legacy/foo-[hash].js" file in the legacy package of this component after packaging
This may be a bug of vite or plugin-legacy
Chrome's version is 63.0.3223.0
<template>
<input-text />
</template>
<script>
// Static import works fine in legacy mode
// import inputText from 'control/text.vue';
export default {
components: {
// If an async component is used, in the production env and legacy mode, the file in node_modules imported inside the component will point to a non-existing path
// But if only one async component is declared and used here, it seems to work fine
InputTextarea: () => import('control/textarea.vue'),
InputNumber: () => import('control/number.vue'),
InputSelect: () => import('control/select.vue'),
InputSwitch: () => import('control/switch.vue'),
InputCheckbox: () => import('control/checkbox.vue'),
InputRadio: () => import('control/radio.vue'),
InputRangepicker: () => import('control/rangepicker.vue'),
InputChips: () => import('control/chips.vue'),
InputText: () => import('control/text.vue')
// inputText
}
};
</script>
component input-text internal
<template>
<!-- from dependency balm-ui's component -->
<ui-textfield v-model="value" />
</template>
<script>
// When this component is called async,the following reference in legacy's packaging code will point to a non-existing module 'textfield'
import 'balm-ui/components/textfield/textfield.css';
export default {
name: 'InputText',
data() {
return {
value: ''
};
}
};
</script>
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
dang0705
changed the title
A bug in the internal import of asyn components in lower versions of chrome
In lower versions of Chrome, the dependencies inside the asynchronous components of vue2 are packaged and an error is reported
Jan 14, 2022
dang0705
changed the title
In lower versions of Chrome, the dependencies inside the asynchronous components of vue2 are packaged and an error is reported
In lower versions of Chrome, the dependencies inside the async components of vue2 reported errors in the production environment
Jan 14, 2022
I looked at the source code of vite and found that there is a registerAssetToChunk method in src/node/plugins/asset.ts, I guess it is a logic error inside this method
Describe the bug
The node_modules resources imported in vue 2 async components, such as "xxx/foo.css", may refer to a nonexistent "../foo-legacy/foo-[hash].js" file in the legacy package of this component after packaging
This may be a bug of vite or plugin-legacy
Chrome's version is 63.0.3223.0
component input-text internal
Reproduction
https://github.com/dang0705/demo-legacy-bug/blob/main/src/components/control/text.vue#L8
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: