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
Circular dependency warning when using @sveltejs/adapter-node #350
Comments
Try to reproduce it without Superforms, as it seems related to zod-to-json-schema. |
@ciscoheat yeah, I definitely think it's related only to That's why I thought of a maybe possible solution of its imports update in |
I'm also wondering why I even have this warning, I don't use |
@ciscoheat I've checked and when yarn add sveltekit-superforms seems like all optional packages are installed: success Saved lockfile.
success Saved 29 new dependencies.
info Direct dependencies
└─ sveltekit-superforms@2.3.0
info All dependencies
├─ @gcornut/valibot-json-schema@0.0.22
├─ @hapi/topo@5.1.0
├─ @poppinss/macroable@1.0.1
├─ @sideway/address@4.1.5
├─ @sideway/formula@3.0.1
├─ @sideway/pinpoint@2.0.0
├─ @sinclair/typebox@0.32.14
├─ @sodaru/yup-to-json-schema@2.0.1
├─ @types/validator@13.11.9
├─ @vinejs/compiler@2.4.0
├─ @vinejs/vine@1.7.1
├─ arktype@1.0.29-alpha
├─ camelcase@8.0.0
├─ dayjs@1.11.10
├─ dlv@1.1.3
├─ joi@17.12.1
├─ just-clone@6.2.0
├─ memoize-weak@1.0.2
├─ normalize-url@8.0.0
├─ property-expr@2.0.6
├─ superstruct@1.0.3
├─ sveltekit-superforms@2.3.0
├─ tiny-case@1.0.3
├─ toposort@2.0.2
├─ ts-deepmerge@7.0.0
├─ validator@13.11.0
├─ yup@1.3.3
├─ zod-to-json-schema@3.22.4
└─ zod@3.22.4 |
All packages are installed, but only the ones used will be bundled. What happens if you uninstall zod-to-json-schema? |
I don't get the warning when building, so if you have a repo that reproduces it, I'll take a look. |
@ciscoheat sure, I've added a reproduction with screenshot: https://github.com/vladshcherbin/svelte-superforms |
As mentioned in the other issue, it doesn't happen when using pnpm. Haven't used yarn (more than when absolutely necessary), so maybe it can be configured to handle it. |
This warnings are coming from rollup, I've seen them before in other projects - issue rollup/rollup#1089 and many other issues/questions in google. They can be configured there (even mentioned in rollup docs) but rare libraries throw them. Surprising pnpm doesn't have them (or somehow suppress), the bundler is the same 🙈 |
So when using The build time is greatly increased here too (without super forms, 46sec for this project and with, 1min 52sec) as it does appear to be bundling them in the first stage, even if they were removed in the second. I'm probably being very stupid, but I too don't see a way to remove these "optional" dependencies, they're in the pnpm-lock with the tag of
Isn't just having them as a |
One minute extra for bundling (and removing) 5-6 extra libraries seems quite strange. The packaging system is complicated, bordering on complex, so removing them from optional causes other issues, resulting in having to add the "middleman" packages such as the JSON Schema generator (specific for each validation library) also as a peerDependency. The most convenient has been to keep them in both, and I haven't heard of any build problems until now, so if you can check further what's going on, and be quite certain that it doesn't have to do with anything else in the build, that would help me figure things out. |
Description
When using SvelteKit,
vite build
givesCircular dependency
warning:The build finishes and is working though.
Would be great to find a way to get rid of it 🙌
sveltekit-superforms - 2.3.0
@sveltejs/adapter-node - 4.0.1
@sveltejs/kit - 2.5.0
svelte - 4.2.11
The text was updated successfully, but these errors were encountered: