Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

betterDefine does not work in Rspack + Vue 2 #812

Open
5 tasks done
huangtiandi1999 opened this issue Sep 13, 2024 · 2 comments
Open
5 tasks done

betterDefine does not work in Rspack + Vue 2 #812

huangtiandi1999 opened this issue Sep 13, 2024 · 2 comments
Labels

Comments

@huangtiandi1999
Copy link

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 sxzz added the Vue 2 label Sep 13, 2024
@sxzz
Copy link
Member

sxzz commented Sep 14, 2024

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

@sxzz sxzz changed the title betterDefine dose not work in Rspack betterDefine does not work in Rspack + Vue 2 Sep 14, 2024
@huangtiandi1999
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants