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

[ plugin-legacy ] 页面内import worker 。构建后,chunk或者 assets目录内并没有生成work文件(已定位问题为使用plugin-legacy导致) #9305

Closed
7 tasks done
dang0705 opened this issue Jul 22, 2022 · 2 comments · Fixed by #9500
Labels
feat: web workers p4-important Violate documented behavior or significantly improves performance (priority) plugin: legacy

Comments

@dang0705
Copy link

dang0705 commented Jul 22, 2022

Describe the bug

import Worker from '@XXX/worker/down-count?worker';

开发源码
image

生产报错
6875f33b922f19f39c499f0e31cb5a1

开发环境 下正常, 构建后生产环境找不到dow-count.js 并报错。进入dist后,也没有生成down-count相关的chunk

### 2022-07-25 问题已定位,在使用 plugin-legacy 的情况下,会出现上述问题,注释legacy代码,worker正常打包

image

Reproduction

git@gitee.com:henry-the-great/vite_worker_bug.git

System Info

System:
    OS: Windows 7
    Memory: 12GB
  Binaries:
    Node: 16.3 - C:\Program Files\nodejs\node.EXE
    npm: 7.24.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    chorme: 103.0.5060.134
    
  npmPackages:
    @vitejs/plugin-vue: ^3.0.1 => 3.0.1
    vite: ^3.0.2 => 3.0.2

Used Package Manager

npm

Logs

No response

Validations

@github-actions
Copy link

Hello @dang0705. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@dang0705 dang0705 changed the title 页面内import worker 。构建后,chunk目录内并没有生成work文件 页面内import worker 。构建后,chunk目录内并没有生成work文件(已知为plugin-legacy) Jul 25, 2022
@dang0705 dang0705 changed the title 页面内import worker 。构建后,chunk目录内并没有生成work文件(已知为plugin-legacy) 页面内import worker 。构建后,chunk或者 assets目录内并没有生成work文件(已知为plugin-legacy) Jul 25, 2022
@dang0705 dang0705 changed the title 页面内import worker 。构建后,chunk或者 assets目录内并没有生成work文件(已知为plugin-legacy) 页面内import worker 。构建后,chunk或者 assets目录内并没有生成work文件(已定位问题为使用plugin-legacy导致) Jul 25, 2022
@dang0705 dang0705 changed the title 页面内import worker 。构建后,chunk或者 assets目录内并没有生成work文件(已定位问题为使用plugin-legacy导致) [ plugin-legacy ] 页面内import worker 。构建后,chunk或者 assets目录内并没有生成work文件(已定位问题为使用plugin-legacy导致) Jul 25, 2022
@sapphi-red sapphi-red added pending triage feat: web workers plugin: legacy p4-important Violate documented behavior or significantly improves performance (priority) and removed needs reproduction pending triage labels Jul 25, 2022
@sapphi-red
Copy link
Member

It seems it happens with plugin-legacy + worker as you said.
Minimal reproduction: https://stackblitz.com/edit/vitejs-vite-nzeh9i?file=package.json

@poyoho poyoho mentioned this issue Aug 2, 2022
9 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: web workers p4-important Violate documented behavior or significantly improves performance (priority) plugin: legacy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants