vue-macros/vue-macros

`betterDefine` does not work in Rspack + Vue 2

Closed this issue · 3 comments

Describe the bug

my project is fork from https://github.com/vue-macros/vue2-rspack, and I want to verify that betterDefine works properly in vue2 when build with Rspack

<script setup lang="ts">
import type { IProps } from './interface.ts';

defineProps<IProps>();
</script>

<template>
  <div>test: {{ msg }}</div>
</template>
export interface IProps {
  msg: string;
}

The rspack.config.js file remains the same

npm run build when the build is performed, the following error occurs

rspack

Reproduction

none

System Info

System:
    OS: macOS 12.5.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 152.05 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 20.9.0 - /usr/local/bin/node
    Yarn: 4.0.2 - /usr/local/bin/yarn
    npm: 8.19.4 - /usr/local/bin/npm
    pnpm: 8.11.0 - /usr/local/bin/pnpm

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
sxzz commented

Confirm that this issue can only be reproduced in Webpack/Rspack + Vue 2 (vue-loader@15).
We have launched a paid support plan to provide continued support for Vue 2 #373

Confirm that this issue can only be reproduced in Webpack/Rspack + Vue 2 (vue-loader@15). We have launched a paid support plan to provide continued support for Vue 2 #373

Ok, I checked the following error in detail, @vue-macros/better-define before v1.7.1 supported Props to reference externally defined TS types, I guess this feature was broken when version 1.7.1 was released

sxzz commented

Closing due to #866