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

[bug]在electron-vite打包的时候报错Cannot find name 'reactive' #519

Open
5 tasks done
thinkiveWJ opened this issue Aug 8, 2024 · 3 comments
Open
5 tasks done

Comments

@thinkiveWJ
Copy link

Describe the bug

在electron-vite开发环境下正常使用,但是打包的时候报错Cannot find name 'reactive'

Reproduction

https://codesandbox.io/p/devbox/cool-bassi-qk7hd7?file=%2Faaaa%2Felectron-app%2Fsrc%2Frenderer%2Fsrc%2FApp.vue%3A8%2C1

System Info

在electron-vite开发环境下正常使用,但是打包的时候报错Cannot find name 'reactive'

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.
@thinkiveWJ
Copy link
Author

复现环境打包的时候报错Cannot find name 'ref'

@thinkiveWJ
Copy link
Author

复现步骤:
1、cd aaaaa/electron-app
2、npm run build

@thinkiveWJ
Copy link
Author

https://codesandbox.io/p/devbox/cool-bassi-qk7hd7?file=%2Faaaa%2Felectron-app%2Fsrc%2Frenderer%2Fsrc%2FApp.vue%3A8%2C1 这个案例无法在线运行;
可在本地运行,具体步骤:
1、npm create @quick-start/electron@latest

2、选vue框架,其他全部选择yes
3、pnpm install
4、pnpm install unplugin-auto-import
5、在app.vue内容修改为

<script setup lang="ts">
const num = ref(1)
</script>

<template>
  <div>{{ num }}</div>
</template>

6、配置unplugin-auto-import
7、可正常运行[npm run dev],但是不能正常打包[npm run build]

@thinkiveWJ thinkiveWJ changed the title 在electron-vite打包的时候报错Cannot find name 'reactive' [bug]在electron-vite打包的时候报错Cannot find name 'reactive' Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant