Closed TeaBough closed 1 year ago
Thanks for reporting the issue.
We haven't been able to determine the cause of the issue from the information provided; could you please prepare a sample repo with a similar structure that reproduces the issue?
I note that this is related to https://github.com/wallabyjs/public/issues/3248. As a part of this issue an update was made that reports the snapshot patching issue as a warning rather than an error. Is the patching failure causing you further problems?
Thanks for looking into this issue 🙏
Here is a basic repo that reproduce the problem : https://github.com/TeaBough/pnpm-monorepo
The test in packages/main/src/simple.test.ts
is running successfully but in the wallaby console I still get :
console.warn: Initialization: Wallaby is not compatible with current version of Vitest.
Could not find inlineSnapshotSaved in entry point for file file:///tmp/pnpm-monorepo/node_modules/.pnpm/vitest@0.34.1_@vitest+ui@0.34.1_jsdom@22.1.0/node_modules/vitest/dist/vendor-index.9378c9a4.js.
console.warn: Initialization: Wallaby is not compatible with current version of Vitest.
Could not find if (hasSnapshot && this._updateSnapshot === "all" || in entry point for file file:///tmp/pnpm-monorepo/node_modules/.pnpm/vitest@0.34.1_@vitest+ui@0.34.1_jsdom@22.1.0/node_modules/vitest/dist/vendor-index.9378c9a4.js.
console.warn: Initialization: Wallaby is not compatible with current version of Vitest.
Could not find this._updateSnapshot = options.updateSnapshot; in entry point for file file:///tmp/pnpm-monorepo/node_modules/.pnpm/vitest@0.34.1_@vitest+ui@0.34.1_jsdom@22.1.0/node_modules/vitest/dist/vendor-index.9378c9a4.js.
console.warn: Initialization: Wallaby is not compatible with current version of Vitest.
Could not find if (this._updateSnapshot === "all" && this._uncheckedKeys.size) { in entry point for file file:///tmp/pnpm-monorepo/node_modules/.pnpm/vitest@0.34.1_@vitest+ui@0.34.1_jsdom@22.1.0/node_modules/vitest/dist/vendor-index.9378c9a4.js.
console.warn: Initialization: Wallaby is not compatible with current version of Vitest.
Could not find if (hasSnapshot && this._updateSnapshot === "all" || (!hasSnapshot || !snapshotIsPersisted) && (this._updateSnapshot === "new" || this._updateSnapshot === "all")) { in entry point for file file:///tmp/pnpm-monorepo/node_modules/.pnpm/vitest@0.34.1_@vitest+ui@0.34.1_jsdom@22.1.0/node_modules/vitest/dist/vendor-index.9378c9a4.js.
console.warn: Initialization: Wallaby is not compatible with current version of Vitest.
Could not find getSnapshotState in entry point for file file:///tmp/pnpm-monorepo/node_modules/.pnpm/vitest@0.34.1_@vitest+ui@0.34.1_jsdom@22.1.0/node_modules/vitest/dist/vendor-index.9378c9a4.js.
Thanks for the repo; we were able to reproduce the issue.
The underlying cause here is that pnpm won't create symlinks for transitive dependencies (by default, by design). This doesn't interfere with packages such as vitest
referring to their own transitive dependencies, but does interfere with Wallaby, which needs to refer to them directly. There are a few ways to resolve this, but the one we're recommending is to add the following lines to your .npmrc
file:
public-hoist-pattern[]=*vitest*
public-hoist-pattern[]=vite-node
We've updated our documentation to include this information: using vitest with pnpm.
We noticed you had explicitly included a couple of vitest
's transitive dependencies in your main/package.json
; the config change described above should make this unnecessary.
Thx it's working now 👍
I'm getting this warning :
It's looking in the wrong node_modules... it's looking for the one at the root of the workspace instead of getting vitest in the module
projectA
... How could I fix that ?