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

chore: fix browser build plugin #6793

Merged
merged 1 commit into from
Oct 26, 2024
Merged

Conversation

userquin
Copy link
Member

@userquin userquin commented Oct 25, 2024

Description

Looks like on my Windows laptop the browser build plugin is finishing before Vite finish building the UI and so there is no UI entry point in the dist folder.

With this PR we ensure the browser/dist/client/__vitest__ folder will always have at least the UI entry point.

/cc @patak-dev IIRC Vite will copy the entry point after building the assets, please confirm this (I think it is true: I deal this it in the PWA plugin)

✔️ confirmed (check step 10 here ;) ) https://vite-pwa-org.netlify.app/guide/cookbook.html#vite-build-cli

Vitest hanging when running any browser test with the UI in my local, running the test:browser:preview script with --reporter=hanging-process:

imagen

imagen

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Oct 25, 2024

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit ebb6011
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/671bc27a18764f0008820b26
😎 Deploy Preview https://deploy-preview-6793--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I can reproduce empty __vitest__ by following commands locally too:

$ rm -rf packages/ui/dist/
$ pnpm --filter @vitest/browser build
...
[copy-ui-plugin] Waiting for UI to be built..

# then in another terminal
$ pnpm --filter @vitest/ui build

@hi-ogawa hi-ogawa merged commit 03a7703 into main Oct 26, 2024
14 of 17 checks passed
@hi-ogawa hi-ogawa deleted the userquin/fix-build-browser-plugin branch October 26, 2024 01:12
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

Successfully merging this pull request may close these issues.

2 participants