Cut back to minimal reproduction #1
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@playerfine thanks for your removals! For future reference, I still wouldn't consider it a minimal reproduction, though. I spent a little time cutting out even more stuff while keeping the bug present.
In doing so, I found that the issue is not related to
nxat all, but simply your particular monorepo structure. (Hence the value in getting to the truly minimal reproduction 😜)I was also able to identify a workaround for the issue: add
"@testing-library/svelte": "^5.2.3"tolibs/counter/package.json:{ "name": "@svelteunit/counter", "version": "0.0.1", "private": true, - "type": "module" + "type": "module", + "devDependencies": { + "@testing-library/svelte": "^5.2.3" + } }This is the only change that is needed, you don't even have to re-run
npm install. This, to me, suggests a potential bug in@sveltejs/vite-plugin-svelte's heuristics around when to apply the Svelte transform to.svelte.jsfiles.I'll dig a little more and file an issue with the Svelte team if I find something concrete. In the mean time, y'all may want to consider moving to a package manager with more robust monorepo support, like
pnpm, which will allow you to define dev dependencies in the projects they're actually used in, but still maintain minimal installs and consistent versions