Skip to content
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

defaultServerConditions is not iterable #435

Closed
birkskyum opened this issue Dec 11, 2024 · 11 comments
Closed

defaultServerConditions is not iterable #435

birkskyum opened this issue Dec 11, 2024 · 11 comments

Comments

@birkskyum
Copy link
Contributor

birkskyum commented Dec 11, 2024

This is hit in

It also seems possible to hit with vinxi 0.5.1 from solid-start.

It's only vite v6 that has the defaultServerConditions, so this happen when a version below v6 is used.

@katywings
Copy link
Collaborator

katywings commented Dec 30, 2024

Getting this with solid-start 1.0.10 + vinxi 0.5.1 + vite 6

Make sure that you override the vite version in your package.json if you are hitting this error. Like so:

"overrides": {
  "vite": "^5.4.11"
},
"pnpm": {
  "overrides": {
    "vite": "^5.4.11"
  }
}

@Marvin-Brouwer
Copy link

@katywings you are a lifesaver.
For some extra context, this also happens with vite@^6 and vite-plugin-solid@^2.11.0. So, it's likely not a vinxi issue.

@birkskyum
Copy link
Contributor Author

birkskyum commented Jan 20, 2025

@Marvin-Brouwer does that repro in stackblitz? Without vinxi

@Marvin-Brouwer
Copy link

Marvin-Brouwer commented Feb 4, 2025

@birkskyum sorry for the late reply, I haven't been able to respond due to personal situation.
I had a quick look, but I couldn't reproduce it with the solidJS starter template.
https://stackblitz.com/edit/solidjs-templates-bchp1qnq?file=vite.config.ts

I had a quick look, I don't think I have exotic stuff.
I have some node polyfills and some css modules stuff but I'm sure I didn't start with that.

I'd need to invest more time, which I don't have at the moment.
Sorry.

@timothyallan
Copy link

Also getting this after upgrading to 0.5.3

Image

@birkskyum
Copy link
Contributor Author

birkskyum commented Mar 1, 2025

@timothyallan make sure you have no vite v5 installations, vinxi 0.5.3 will attempt to pull in vite 6 which is needed here.

make sure you also are on the latest version of @solidjs/start / @solidjs/router / vite-plugin-solid / solid-js

@Eliot00
Copy link

Eliot00 commented Mar 4, 2025

I can build locally but get errors in cloudflare pages.

20:12:07.174 | 📦 Compiling ssr router...
-- | --
20:12:07.174 | vinxi building router ssr in http mode
20:12:07.446 | [error] defaultServerConditions is not iterable
20:12:07.446 | at configEnvironment (node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-plugin-solid/dist/esm/index.mjs:133:43)
20:12:07.447 | at async runConfigEnvironmentHook (node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-ByPKlqZ5.js:54653:19)
20:12:07.447 | at async resolveConfig (node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-ByPKlqZ5.js:54038:3)
20:12:07.447 | at async createBuilder (node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-ByPKlqZ5.js:51930:18)
20:12:07.447 | at async Module.build (node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-ByPKlqZ5.js:51219:19)
20:12:07.447 | at async createViteBuild (node_modules/.pnpm/[email protected][email protected]/node_modules/vinxi/lib/build.js:395:17)
20:12:07.447 | at async createRouterBuild (node_modules/.pnpm/[email protected][email protected]/node_modules/vinxi/lib/build.js:529:2)
20:12:07.447 | at async node_modules/.pnpm/[email protected][email protected]/node_modules/vinxi/lib/build.js:59:5
20:12:07.447 | at async createBuild (node_modules/.pnpm/[email protected][email protected]/node_modules/vinxi/lib/build.js:58:4)
20:12:07.447 | at async Object.run (node_modules/.pnpm/[email protected][email protected]/node_modules/vinxi/bin/cli.mjs:235:5)
20:12:07.448 | at async runCommand (node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:316:16)
20:12:07.448 | at async runCommand (node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:307:11)
20:12:07.448 | at async runMain (node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:445:7)
20:12:07.448 |  
20:12:07.448 | [error] defaultServerConditions is not iterable
20:12:07.457 | [error] Exited with code: 1
20:12:07.457 | at CommandChild.pipedStdoutBuffer (node_modules/.pnpm/[email protected]/node_modules/dax-sh/esm/mod.js:9392:19)
20:12:07.457 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
20:12:07.457 |  
20:12:07.458 | [error] Exited with code: 1
20:12:07.469 | ELIFECYCLE  Command failed with exit code 1.
20:12:07.498 | Failed: Error while executing user command. Exited with error code: 1
20:12:07.508 | Failed: build command exited with code: 1
20:12:08.309 | Failed: error occurred while running build command

my package.json:

{
  "name": "example-basic",
  "type": "module",
  "scripts": {
    "dev": "vinxi dev",
    "build": "vinxi build",
    "start": "vinxi start",
    "version": "vinxi version",
    "preview": "pnpm run build && npx wrangler pages dev",
    "deploy": "pnpm run build && wrangler pages deploy"
  },
  "dependencies": {
    "@corvu/drawer": "^0.2.2",
    "@kobalte/core": "^0.13.7",
    "@solidjs/meta": "^0.29.4",
    "@solidjs/router": "^0.15.3",
    "@solidjs/start": "^1.1.3",
    "@supabase/ssr": "^0.5.2",
    "@supabase/supabase-js": "^2.46.1",
    "@unocss/reset": "^0.64.1",
    "class-variance-authority": "^0.7.0",
    "clsx": "^2.1.1",
    "lucide-solid": "^0.460.0",
    "solid-js": "^1.9.5",
    "tailwind-merge": "^2.5.4",
    "ts-fsrs": "^4.5.2",
    "unocss-preset-animations": "^1.1.0",
    "vinxi": "^0.5.3"
  },
  "engines": {
    "node": ">=18"
  },
  "devDependencies": {
    "@cloudflare/workers-types": "^4.20241106.0",
    "unocss": "^0.64.1",
    "wrangler": "^3.112.0"
  }
}

@birkskyum
Copy link
Contributor Author

birkskyum commented Mar 4, 2025

@Eliot00 , notice the "[email protected]" in the output you shared - that's the issue. There is a vite 5 installation.

You can try to delete and recreate your lockfile, or explicit add vite 6 to the list of dependencies.

Or, depending on which package manager you use, add vite 6 to the overrides / resolutions in package.json to force use of vite 6

@Eliot00
Copy link

Eliot00 commented Mar 4, 2025

@birkskyum Thank you for your response. I just managed to deploy successfully by building locally and uploading the assets without making any changes to the code. I'm not sure why the Cloudflare Github automatic integration deployment method is throwing an error. I'll try upgrading Vite later to see if that resolves the issue.

@birkskyum
Copy link
Contributor Author

Excellent! It could be a cache somewhere causing problems.

@AlexErrant
Copy link

AlexErrant commented Mar 5, 2025

Hah yeah I forgot to update vite (and vinxi) and Birk's advice fixed it - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants