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

After Vite 4.2 upgrade, the manifest.json file cannot be generated after using sharedwork #12627

Closed
7 tasks done
AlexStacker opened this issue Mar 28, 2023 · 6 comments
Closed
7 tasks done
Labels
duplicate This issue or pull request already exists

Comments

@AlexStacker
Copy link

Describe the bug

After Vite 4.2 upgrade, the manifest.json file cannot be generated after using sharedwork

Only show so few assets lines:

{
  "sharedwork.js": {
    "file": "assets/sharedwork-9c4decac.js",
    "isEntry": true,
    "src": "sharedwork.js"
  }
}

It seems that Rollup has change the method finalizeAdditionalAsset.
rollup/rollup@75c5113#diff-016e61f8e680c4307db5ae6252b432289d01f2d31802ce47892a9b832cd6abc2R398-R400

Reproduction

https://stackblitz.com/edit/vitejs-vite-jb9po3?file=main.js&terminal=dev

Steps to reproduce

After run build, check the manifest.json file in the dist directory

System Info

System:
    OS: macOS 12.6.3
    CPU: (10) x64 Apple M1 Pro
    Memory: 36.00 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.19.3 - ~/.nvm/versions/node/v14.19.3/bin/node
    npm: 6.14.17 - ~/.nvm/versions/node/v14.19.3/bin/npm
  Browsers:
    Chrome: 110.0.5481.177
    Edge: 111.0.1661.54
    Firefox: 111.0.1
    Safari: 16.4
  npmPackages:
    vite: ^4.2.1 => 4.2.1

Used Package Manager

npm

Logs

No response

Validations

@stackblitz
Copy link

stackblitz bot commented Mar 28, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@vinayakkulkarni
Copy link

It seems there is an issue with Workers with latest version of vite, reference to another Web Worker issue – #12611 (comment)

@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) feat: web workers labels Mar 28, 2023
@sapphi-red
Copy link
Member

Duplicate of #10190

@sapphi-red sapphi-red marked this as a duplicate of #10190 Mar 29, 2023
@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2023
@sapphi-red sapphi-red added duplicate This issue or pull request already exists and removed p3-minor-bug An edge case that only affects very specific usage (priority) feat: web workers labels Mar 29, 2023
@sun0day
Copy link
Member

sun0day commented Mar 29, 2023

It seems that this has been fixed in the main.

image

@sapphi-red
Copy link
Member

@sun0day It seems there's a race condition.

@AlexStacker
Copy link
Author

AlexStacker commented Mar 29, 2023

It seems that this has been fixed in the main.

Hey @sun0day I tested with the latest 4.3.0-beta.1 still exist. When I was debugging, I found that the emitFile in the manifest.ts is triggered the output of manifest.json twice. Once it output the content of the file we saw below:

{
    "sharedwork.js": {
      "file": "assets/sharedwork-9c4decac.js",
      "isEntry": true,
      "src": "sharedwork.js"
    }
}

and the second time it output the content of assets, but it was not written to the file. So should it output 2 manifest.json files or should it be combined into one file for output.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants