-
Notifications
You must be signed in to change notification settings - Fork 52
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
Warning: "deps.registerNodeLoader" is deprecated #114
Comments
Same with me. Another weird thing that I cannot figure out for the life of me @jtmueller is that when I have the |
You can remove the warning by using optimizer and server config: test: {
server: {
deps: {
// fixes: You appear to have multiple instances of Solid. This can lead to unexpected behavior.
inline: [/solid-js/],
},
},
deps: {
// fixes: Vitest "deps.registerNodeLoader" is deprecated. If you rely on aliases inside external packages, use "deps.optimizer.web.include" instead.
optimizer: {
web: {
enabled: true,
},
},
},
} https://github.com/vitest-dev/vitest/releases/tag/v0.34.0
|
@alarivan Thanks, that gets rid of the warning for me - I was logging the issue mostly so that the next version of vite-plugin-solid wouldn't trigger the deprecation warning by default, but I appreciate the workaround. @GitMurf I was seeing the deprecation warning twice, but at least after applying the above workaround, the actual tests don't seem to run more than once. |
FYI see this thread for the solution to my additi issue mentioned above: #101 (comment) |
@Tur8008 I was also unable to suppress the deprecation message using the above recommendations. This message seems to be caused by the vite-plugin-solid/src/index.ts Line 338 in 7e667ad
I was able to develop a workaround that patches-out the deprecated property (setting it to
- import { defineConfig } from "vitest/config";
+ import { type UserConfig, defineConfig } from "vitest/config";
import SolidPlugin from "vite-plugin-solid";
export default defineConfig({
// ...
plugins: [
- SolidPlugin(),
+ // @workaround
+ // `"deps.registerNodeLoader" is deprecated.`
+ (() => {
+ const plugin = SolidPlugin();
+ const { config } = plugin;
+ return Object.assign(plugin, {
+ config: async (...args: any[]) => {
+ const result: UserConfig = await (config as any)(...args);
+ if (result.test?.deps?.registerNodeLoader) {
+ result.test.deps.registerNodeLoader = undefined;
+ }
+ return result;
+ },
+ });
+ })(),
],
// ...
}); I'm not sure whether or not this patched-out property will cause any other problems -- but for now it seems okay! [edit 1] [edit 2] Turns out I made a mistake in the original version of my workaround diff causing a config error if not running in the "test" |
Works also with |
|
When running
vitest
0.34.2, if I havevite-plugin-solid
registered as a plugin, the following warning is logged:If I remove
vite-plugin-solid
from the vitest config, no warnings are logged.The text was updated successfully, but these errors were encountered: