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

The production of Metronic 9 React is not built correctly


I purchased Metronic.

The DEV (yarn dev) version runs without problems. I'm trying to build and run a test DIST (yarn build) version on the server. But I get a blank screen at the address of the public server. I have one file in the dist folder (/metronic/metronic-v9.1.2/metronic-tailwind-react/typescript/vite/dist) "index.html " and 2 folders "assets" and "media".

At the same time, inside the file index.html I have links to "/metronic/tailwind/react/media/app" and "/metronic/tailwind/react/assets" that are not physically present.

What did I do wrong?


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 (1)


Hi Константин Прогацкий

Sorry for the delay in responase. Since you're deploying the app to a subfolder (like /metronic/tailwind/react/), Vite needs to know about that during the build. By default, Vite assumes the app will be hosted at the root (/), so all links in index.html are generated that way.

To fix this, you should update the base option in your vite.config.ts file:

// vite.config.ts
import { defineConfig } from "vite"

export default defineConfig({
base: "/metronic/tailwind/react/", // your subfolder path here
// other config...
})


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  :(