Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure project to use local vitest
This took a bit of figuring out. The process was: - Add `.npmrc` to this repo per: - https://pnpm.io/npmrc#auto-install-peers - https://pnpm.io/npmrc#prefer-frozen-lockfile - https://pnpm.io/npmrc#prefer-workspace-packages - `git clone https://github.com/vitest-dev/vitest.git` in the parent directory of this repository. - Add 'file:' dependencies to vitest and @vitest/browser, both residing within '../vitest/packages'. https://pnpm.io/cli/link#whats-the-difference-between-pnpm-link-and-using-the-file-protocol - Add pnpm-workspace.yaml with an '../vitest/packages/*' entry so the local vitest modules can find their peer modules in the same workspace. https://pnpm.io/pnpm-workspace_yaml - Set vite to 4.5.1, since I eventually learned the problem always occurs with vite 5.0.5. (I suspect this may have something to do with the upgrade from Rollup 4 to Rollup 5.) Then in the `../vitest` directory: ```sh git reset --hard v1.0.0-beta.4 pnpm i --ignore-scripts --frozen-lockfile pnpm build ``` And back in this repository: ```sh pnpm i pnpm test ``` I can now get the demo test running successfully against the local vitest v1.0.0-beta.4. Repeating the process for v1.0.0-beta.5, I can reproduce the vitest/utils import problem/reload loop. Now let's see what a `git bisect` will produce... ...one thing I already noticed: - The vitest packages from v1.0.0-beta.4 depend on vite < 5.0.0 - The vitest packages from v1.0.0-beta.5 depend on vite >= 5.0.0-beta* So...could be the issue resides within Vite somehow. The vitest repo is OK up through this commit, which is the last working commit before the Vite ^5.0.0 bump: - commit f6a445dbc86e0e5b7de29ae650ecebf8ac6e4ffa The next commit breaks the pnpm-lock.yaml file, and remains broken until the following commit and the PR containing it gets merged: - commit 5b738663197b78cf103b269c6e7489286957c1a7 - vitest-dev/vitest#4368 ```sh git diff f6a445dbc86e0e5b7de29ae650ecebf8ac6e4ffa 5b738663197b78cf103b269c6e7489286957c1a7 ``` Yep. None of the changes there seem to have anything directly to do with packages/browser/src/client/main.ts or the `config.base` value. It seems to be the Vite 5 upgrade, which is consistent with the fact that v1.0.0-beta.4 works with Vite 4.5.1, but not Vite 5.0.5. Now that I've got my methodology down, next I'll start bisecting commits in Vite.
- Loading branch information