Introducing ReUI:Open-source UI components and apps built with React, Next.js and Tailwind CSS
Browse ReUI

Error Integrating Metronic 9 with Laravel



~/PhpstormProjects/cms-app git:[main]
pnpm run build

> @ build /home/alex/PhpstormProjects/cms-app
> vite build

vite v5.4.0 building for production...
✓ 58 modules transformed.
x Build failed in 635ms
error during build:
[vite:css] [postcss] Cannot read properties of undefined (reading "light")
file: /home/alex/PhpstormProjects/cms-app/resources/css/app.scss:undefined:NaN
at getDefaultGrayColors (/home/alex/PhpstormProjects/cms-app/resources/metronic/core/plugins/components/theme.js:32:41)
at /home/alex/PhpstormProjects/cms-app/resources/metronic/core/plugins/components/theme.js:119:7
at registerPlugins (/home/alex/PhpstormProjects/cms-app/node_modules/.pnpm/tailwindcss@3.4.10/node_modules/tailwindcss/lib/lib/setupContextUtils.js:815:61)
at createContext (/home/alex/PhpstormProjects/cms-app/node_modules/.pnpm/tailwindcss@3.4.10/node_modules/tailwindcss/lib/lib/setupContextUtils.js:1221:5)
at getContext (/home/alex/PhpstormProjects/cms-app/node_modules/.pnpm/tailwindcss@3.4.10/node_modules/tailwindcss/lib/lib/setupContextUtils.js:1278:19)
at /home/alex/PhpstormProjects/cms-app/node_modules/.pnpm/tailwindcss@3.4.10/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:118:81)
at /home/alex/PhpstormProjects/cms-app/node_modules/.pnpm/tailwindcss@3.4.10/node_modules/tailwindcss/lib/processTailwindFeatures.js:46:11)
at plugins (/home/alex/PhpstormProjects/cms-app/node_modules/.pnpm/tailwindcss@3.4.10/node_modules/tailwindcss/lib/plugin.js:38:69)
at LazyResult.runOnRoot (/home/alex/PhpstormProjects/cms-app/node_modules/.pnpm/postcss@8.4.41/node_modules/postcss/lib/lazy-result.js:329:16)
at LazyResult.runAsync (/home/alex/PhpstormProjects/cms-app/node_modules/.pnpm/postcss@8.4.41/node_modules/postcss/lib/lazy-result.js:258:26)


/* Main style */
@tailwind base;
@tailwind components;
@tailwind utilities;


@import "../metronic/vendors/keenicons/duotone/style.css";
@import "../metronic/vendors/keenicons/filled/style.css";
@import "../metronic/vendors/keenicons/outline/style.css";
@import "../metronic/vendors/keenicons/solid/style.css";


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi Alex,

Are you using Laravel from our sample project on GitHub?
https://github.com/keenthemes/metronic-tailwind-html-integration

We're unsure if `pnpm` works the same way as `npm` for this setup. Could you please try running the installation commands with `npm install` and `npm run build` instead?

For further details, please refer to the documentation if you haven't already:

https://keenthemes.com/metronic/tailwind/docs/getting-started/integration/laravel

Thank you!



Can I configure it to use Livewire?



Yes, you can configure the Laravel project to use Livewire. While we haven't installed Livewire in the project by default, you can easily add it by following the installation instructions in the Livewire documentation

https://livewire.laravel.com


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(