1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How to use flowbite in angular 18 ssr?

Discussão em 'Angular' iniciado por Tom Jack, Outubro 3, 2024 às 11:43.

  1. Tom Jack

    Tom Jack Guest

    I want to use flowbite in my angular project.

    But I get the error like that.

    4:18:15 PM [vite] Error when evaluating SSR module /main.server.mjs:
    |- ReferenceError: document is not defined
    at eval (F:\Cowboy\companies\IOT-Billing\source\OnLineSignUp\.angular\cache\18.2.3\vite\deps_ssr\flowbite.js:4810:13)
    at async instantiateModule (file:///F:/Cowboy/companies/IOT-Billing/source/OnLineSignUp/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52844:5)

    4:18:15 PM [vite] Internal server error: document is not defined
    at eval (F:\Cowboy\companies\IOT-Billing\source\OnLineSignUp\.angular\cache\18.2.3\vite\deps_ssr\flowbite.js:4810:13)
    at async instantiateModule (file:///F:/Cowboy/companies/IOT-Billing/source/OnLineSignUp/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52844:5)
    4:18:17 PM [vite] Internal server error: document is not defined
    at eval (F:\Cowboy\companies\IOT-Billing\source\OnLineSignUp\.angular\cache\18.2.3\vite\deps_ssr\flowbite.js:4810:13)
    at async instantiateModule (file:///F:/Cowboy/companies/IOT-Billing/source/OnLineSignUp/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52844:5) (x2)


    I insert some code in tailwind.config.js file like that.

    module.exports = {
    content: [
    "./src/**/*.{html,ts}",
    "./node_modules/flowbite/**/*.js" // add this line
    ],
    theme: {
    extend: {},
    },
    plugins: [
    require('flowbite/plugin')
    ],
    }

    Continue reading...

Compartilhe esta Página