-
Hi, I've consistently had issues with getting the solidjs vite plugin to work properly with vitest's workspace structure. I've already raised an issue in that repository (solidjs/vite-plugin-solid#102), but I'm trying to debug the problem further and I'm not sure if it's a problem with the plugin, or a problem somewhere else with Vitest. The minimum reproduction is here: https://stackblitz.com/edit/solidjs-templates-zxnf4p?file=README.md The problem is roughly this:
Some notes I've made while trying to debug this:
My questions:
Thanks for any help/advice that you can offer. As you can see from the original issue, I've been running into this same issue for over a year now, and it would be really good to get it fixed soon! I'm happy to implement the necessary changes, but I'm unsure where to start right now. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The first thing I tried is to run Vitest with Looking at this, the transform seems same, so the next thing I suspected is NodeJS import condition and indeed it looks like there's a difference if you print
Then I remembered now this is a known issue and custom resolve condition like https://github.com/solidjs/vite-plugin-solid/blob/873f4cec4db1dcffac9d909191cf828a9902a418/src/index.ts#L239-L243 is not supported for Vitest workspace. There might be a few workaround for this. Like Marko's case, you might try |
Beta Was this translation helpful? Give feedback.
The first thing I tried is to run Vitest with
VITE_NODE_DEBUG_DUMP=1
. This will dump Vitest/Vite's transform, so you can see howimport
is rewritten. For example, I can seesolid-js/store
became.../node_modules/solid-js/store/dist/dev.js
https://stackblitz.com/edit/solidjs-templates-em2dzk?file=debug-vite-node-frontend%2F_home_projects_solidjs-templates-zxnf4p_frontend_test_spec_ts--1534932233.jsLooking at this, the transform seems same, so the next thing I suspected is NodeJS import condition and indeed it looks like there's a difference if you print
process.execArgv
https://stackblitz.com/edit/solidjs-templates-em2dz…