barvian / fluid-tailwind

Build better responsive designs in less code.
https://fluid.tw
MIT License
1.25k stars 19 forks source link

[Nuxt 3] Build error #50

Open motion-work opened 1 month ago

motion-work commented 1 month ago

I installed this package in my nuxt 3 (v3.13.2) but after building and serving the site I am getting this error:

[nuxt] [request error] [unhandled] [500] fluid is not a function
  at ./.output/server/chunks/build/server.mjs:10284:13
  at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
  at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
  at async ./.output/server/chunks/routes/renderer.mjs:149:24
  at async ./.output/server/chunks/routes/renderer.mjs:240:64
  at async Object.handler (./.output/server/chunks/routes/renderer.mjs:20:22)
  at async Object.handler (./.output/server/chunks/runtime.mjs:3167:19)
  at async Server.toNodeHandle (./.output/server/chunks/runtime.mjs:3438:7)

in my tailwind.config.js: import fluid, { extract, screens } from 'fluid-tailwind'

  plugins: [
    fluid({
      checkSC144: false,
    }),
  ],

When I run yarn dev it works as expected. Any idea why and how to solve this issue?

barvian commented 3 weeks ago

Hi, are you using @nuxtjs/tailwindcss?

martijndewit commented 2 weeks ago

Also got a build error, now after upgrading to nuxt 3.14.0

I'm using Nuxt UI

[unhandledRejection] Cannot read properties of undefined (reading 'prefix')                      2:46:37 PM

  at extract (node_modules/fluid-tailwind/dist/index.js:15430:43)
  at node_modules/@nuxtjs/tailwindcss/dist/module.mjs:135:18
  at _defu (node_modules/defu/dist/defu.mjs:31:19)
  at _defu (node_modules/defu/dist/defu.mjs:37:21)
  at node_modules/defu/dist/defu.mjs:52:33
  at Array.reduce (<anonymous>)
  at node_modules/defu/dist/defu.mjs:52:16
  at configMerger (node_modules/@nuxtjs/tailwindcss/dist/module.mjs:138:5)
  at configs.reduce.configMerger.content.files (node_modules/@nuxtjs/tailwindcss/dist/module.mjs:249:23)
  at Array.reduce (<anonymous>)

got it when running npm run dev.

barvian commented 2 weeks ago

@motion-work I can't reproduce this locally on Nuxt 3.13.2. Would you be able to provide a reproduction?