solid-start: [Bug?]: SolidStart fails to start with Daisyui and tailwindcss

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

After installing daisyui following their documentation and adding it to tailwindcss, the server fails to build the client and I can’t start the dev server.

here is the output

> bun dev
$ vinxi dev
vinxi v0.3.11
vinxi starting dev server

  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose


🌼   daisyUI 4.11.1
β”œβ”€ βœ”οΈŽ 2 themes added            https://daisyui.com/docs/themes
╰─ β˜… Star daisyUI on GitHub     https://github.com/saadeghi/daisyui

/home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/@solidjs+start@1.0.0_rollup@4.18.0_solid-js@1.8.17_vinxi@0.3.11_@opentelemetry+api@1.8.0_@typ_cofjxkxhwsoh6svfiqk3i4goem/node_modules/@solidjs/start/dist/server/StartServer.jsx:65
  __vite_ssr_import_6__.useAssets(() => assets.length ? assets.map((m) => __vite_ssr_import_8__.renderAsset(m)) : void 0);
                                               ^

TypeError: Cannot read properties of undefined (reading 'length')
    at eval (/home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/@solidjs+start@1.0.0_rollup@4.18.0_solid-js@1.8.17_vinxi@0.3.11_@opentelemetry+api@1.8.0_@typ_cofjxkxhwsoh6svfiqk3i4goem/node_modules/@solidjs/start/dist/server/StartServer.jsx:65:48)
    at Array.<anonymous> (file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/server.js:539:57)
    at injectAssets (file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/server.js:584:70)
    at doShell (file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/server.js:295:12)
    at Object.onDone (file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/server.js:163:5)
    at Te.flush (file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/seroval@1.0.7/node_modules/seroval/dist/esm/production/index.mjs:17:38999)
    at file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/server.js:182:42

Node.js v20.11.1
error: script "dev" exited with code 1

However the build process works and the nitro server doesn’t fail

Expected behavior πŸ€”

Start the dev server without errors

Steps to reproduce πŸ•Ή

Steps:

when a command is [cmd1|cmd2] means I rand both of then to test.

  1. run [pnpm|npm] create solid and check the tailwindcss option
  2. run [bun|pnpm|yarn] install daisyui@latest
  3. then alter the tailwindcss file:
/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./src/**/*.{html,js,jsx,ts,tsx}"],
  theme: {
    extend: {}
  },
  plugins: [
    require('daisyui'),
  ]
};
  1. run [bun|pnpm] dev, then, open the browser, the output in the terminal should be:
> bun dev
$ vinxi dev
vinxi v0.3.11
vinxi starting dev server

  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose


🌼   daisyUI 4.11.1
β”œβ”€ βœ”οΈŽ 2 themes added            https://daisyui.com/docs/themes
╰─ β˜… Star daisyUI on GitHub     https://github.com/saadeghi/daisyui

/home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/@solidjs+start@1.0.0_rollup@4.18.0_solid-js@1.8.17_vinxi@0.3.11_@opentelemetry+api@1.8.0_@typ_cofjxkxhwsoh6svfiqk3i4goem/node_modules/@solidjs/start/dist/server/StartServer.jsx:65
  __vite_ssr_import_6__.useAssets(() => assets.length ? assets.map((m) => __vite_ssr_import_8__.renderAsset(m)) : void 0);
                                               ^

TypeError: Cannot read properties of undefined (reading 'length')
    at eval (/home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/@solidjs+start@1.0.0_rollup@4.18.0_solid-js@1.8.17_vinxi@0.3.11_@opentelemetry+api@1.8.0_@typ_cofjxkxhwsoh6svfiqk3i4goem/node_modules/@solidjs/start/dist/server/StartServer.jsx:65:48)
    at Array.<anonymous> (file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/server.js:539:57)
    at injectAssets (file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/server.js:584:70)
    at doShell (file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/server.js:295:12)
    at Object.onDone (file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/server.js:163:5)
    at Te.flush (file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/seroval@1.0.7/node_modules/seroval/dist/esm/production/index.mjs:17:38999)
    at file:///home/me/repo/warpfactor/autodialer/client/node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/server.js:182:42

Node.js v20.11.1
error: script "dev" exited with code 1

Context πŸ”¦

I’m trying to make a website with tailwindcss, daisyui to be deployed to cloudflare workers

Your environment 🌎

System:
   os: Linux fedora 6.8.9-300.fc40.x86_64 
   cpu: amd64
Binaries:
   node: v20.11.1
   pnpm: 9.1.2
   bun: 1.1.4
Packages:
    "@solidjs/router": "^0.13.3",
    "@solidjs/start": "^1.0.0",
    "autoprefixer": "^10.4.19",
    "postcss": "^8.4.38",
    "solid-js": "^1.8.17",
    "tailwindcss": "^3.4.3",
    "vinxi": "^0.3.11"

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 11
  • Comments: 20

Most upvoted comments

I think my last PR already implemented the equivalent of that fix, since I just gave assets a default value.

Iβ€˜m alos having this issue, but I did not use any ui framework…

Lol, I think there is a problem with the template, I just went through the manual process of adding tailwind in the basic template and It worked.