Problems with vite

I’m trying to install tailwind (or anything I guess) into my project and it is throwing this error:

Original Post on Discord

by user 483253293477265409


While resolving: @vitejs/plugin-basic-ssl@0.1.2
Found: vite@4.3.9
node_modules/vite
  peer vite@"^4.0.0" from @sveltejs/vite-plugin-svelte@2.4.2
  node_modules/@sveltejs/vite-plugin-svelte
    peer @sveltejs/vite-plugin-svelte@"^2.2.0" from @sveltejs/vite-plugin-svelte-inspector@1.0.3
    node_modules/@sveltejs/vite-plugin-svelte-inspector
      @sveltejs/vite-plugin-svelte-inspector@"^1.0.3" from @sveltejs/vite-plugin-svelte@2.4.2
    dev @sveltejs/vite-plugin-svelte@"^2.0.4" from the root project
  peer vite@"^4.0.0" from @sveltejs/vite-plugin-svelte-inspector@1.0.3
  node_modules/@sveltejs/vite-plugin-svelte-inspector
    @sveltejs/vite-plugin-svelte-inspector@"^1.0.3" from @sveltejs/vite-plugin-svelte@2.4.2
  peer vite@">=2.0.0" from vite-plugin-compression@0.5.1
  node_modules/vite-plugin-compression
    dev vite-plugin-compression@"^0.5.1" from the root project
  peerOptional vite@"^3.0.0 || ^4.0.0" from vitefu@0.2.4
  node_modules/vitefu
    vitefu@"^0.2.4" from @sveltejs/vite-plugin-svelte@2.4.2
    node_modules/@sveltejs/vite-plugin-svelte
      peer @sveltejs/vite-plugin-svelte@"^2.2.0" from @sveltejs/vite-plugin-svelte-inspector@1.0.3
      node_modules/@sveltejs/vite-plugin-svelte-inspector
        @sveltejs/vite-plugin-svelte-inspector@"^1.0.3" from @sveltejs/vite-plugin-svelte@2.4.2
      dev @sveltejs/vite-plugin-svelte@"^2.0.4" from the root project
  dev vite@"^4.2.0" from the root project```

*by user 483253293477265409*
peer vite@"^3.0.0-beta.0" from @vitejs/plugin-basic-ssl@0.1.2
node_modules/@vitejs/plugin-basic-ssl
  dev @vitejs/plugin-basic-ssl@"^0.1.2" from the root project

Conflicting peer dependency: vite@3.2.7
node_modules/vite
  peer vite@"^3.0.0-beta.0" from @vitejs/plugin-basic-ssl@0.1.2
  node_modules/@vitejs/plugin-basic-ssl
    dev @vitejs/plugin-basic-ssl@"^0.1.2" from the root project

Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

by user 483253293477265409

And this is my package.json file:

by user 483253293477265409

  "name": "my-needle-engine-package",
  "version": "1.0.0",
  "type": "module",
  "scripts": {
    "start": "vite --host",
    "build:dev": "vite build",
    "build:production": "npm run build:dev && npm run gltf:transform",
    "gltf:transform": "npm run transform --prefix node_modules/@needle-tools/gltf-build-pipeline"
  },
  "dependencies": {
      "@needle-tools/engine": "^3.7.2-alpha",
      "three": "npm:@needle-tools/three@0.146.10",
      "needle.sveltesample": "file:./../../Runtime/Svelte Project Sample/Needle.SvelteSample~"
    },
  "devDependencies": {
      "@needle-tools/helper": "^0.7.4",
      "@types/three": "0.146.0",
      "@vitejs/plugin-basic-ssl": "^0.1.2",
      "typescript": "^5.0.2",
      "vite": "^4.2.0",
      "vite-plugin-compression": "^0.5.1",
      "@sveltejs/vite-plugin-svelte": "^2.0.4",
      "@tsconfig/svelte": "^4.0.1",
      "svelte": "^3.55.1",
      "svelte-check": "^3.1.4",
      "svelte-preprocess": "^5.0.3"
    }
}```

*by user 483253293477265409*

The thing runs fine but I’m not able to install anything if I want to

by user 483253293477265409

You are using an very old version of the vitejs/plugin-basic-ssl plugin and should consider updating. https://www.npmjs.com/package/@vitejs/plugin-basic-ssl

I mean, thats the things that came from the needle workspace

by user 483253293477265409

When you change versions (like update vite to v4.x) then you might also need to update other dependencies. That’s not needle specific

It’s what you have to do with any web / npm project

And this? does this mean that I have to have version 12.5, 14 or 16?

by user 483253293477265409

It means that node 18 is not officially supported by squoosh, yep. But it works fine with 18 too

Which version and which sample / template? I don’t think we’re shipping broken package.jsons right now, but of course we may have overlooked something