-
Notifications
You must be signed in to change notification settings - Fork 6
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
Absolute path matching problem for npx svench
command on Windows
#30
Comments
npx svench
command on Windowsnpx svench
command on Windows
I borrowed from sveltejs/vite-plugin-svelte@7a7f908 and tried to create a temporary patch on my machine by editing svench/cli/commands/vite/dev.js. I succeeded it getting it one step further by getting loadVite() to run but then ran into a problem with loadSvenchifiedConfig(). See my attempt at https://gist.github.com/jwrunner/adeb4b0e4f9c20d881f080e1f77b3e58 A permanent patch may belong in normalizeGlobalOptions() or neighbors in svench/cli/cli.js? |
Thanks for reporting. Can you please try with version v0.2.0-20 (tagged next on npm, so something like If you still have the problem, can you post the complete errors that you get, including stack trace (you can edit out the complete paths on your machine if you want, but the actual call stack & line numbers in Svench files is important). |
OK thanks for all the debugging. I'll try your repro in a Windows box to fix all the problematic paths. Note, however, that we don't really have support for Kit projects yet unfortunately... |
Hi @JWRunner! Sorry for taking so long to come back at this, things kinda crazy at works these days... Anyway thanks again for your investigative work, it really helped. I was able to reproduce your issue in a Windows box, then I changed all dynamic imports that target an absolute path on the fs to a custom version that makes sure we're doing so with URLs. Now it seems to run well both on Windows and Linux, so we have a candidate fix. Can you try [email protected] (currently tagged |
Wonderful! Running npx svench works on Windows with [email protected]. Thank you for helping get this fixed as I've been chomping at the bit to try it out. Storybook is slow and large and your tool here is just perfect! |
When running
npx svench
on Windows using version 0.2.0-14, I immediately receive the error:Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
Windows Subsystem for Linux is not an option either as it throws:
error: The working directory "/mnt/c/dev/kit-svench" is not an absolute path
nodejs/node#31710 provides some context and sveltejs/vite-plugin-svelte#29 makes me think the solution will be found in wrapping the culprit url in url.pathToFileURL().
Repro: https://github.com/jwrunner/svelte-kit-svench
The text was updated successfully, but these errors were encountered: