docs icon indicating copy to clipboard operation
docs copied to clipboard

Not all icons were bundled during build (tested with fresh project)

Open claytonchew opened this issue 1 year ago • 1 comments

Issue

Not all icons were bundled (missing) during build, some icons were missing when run on production.

SCR-20240508-skjj

SCR-20240508-sklb

SCR-20240508-skrv

Outcome is the same with

npm run build then node .output/server/index.mjs locally. ❌ docker build and run

Reproduction

Start completely from fresh project

npx nuxi init -t github:nuxt-ui-pro/docs

Run build

npm run build

Run server locally

node .output/server/index.mjs

claytonchew avatar May 08 '24 13:05 claytonchew

Seems like it is resolved by having it built twice (one after the other).

npm run build
npm run build

claytonchew avatar May 09 '24 16:05 claytonchew

My workaround:

npm run prepare
npm run build 

kingyue737 avatar Jun 24 '24 04:06 kingyue737

Can we close this? Have you made sure to register the @nuxt/content before @nuxt/ui?

benjamincanac avatar Jul 11 '24 08:07 benjamincanac

I didn't touch the module orders. Official sites like @nuxt/content have the same issue:

image

kingyue737 avatar Jul 11 '24 08:07 kingyue737

Nuxt Image:

image

kingyue737 avatar Jul 11 '24 08:07 kingyue737

Are you deploying on Cloudflare?

benjamincanac avatar Jul 11 '24 08:07 benjamincanac

Yes. I can also reproduce locally if I run nuxi cleanup before build. It will also show the following warning during build:

warn - The `purge`/`content` options have changed in Tailwind CSS v3.0.
warn - Update your configuration file to eliminate this warning.
warn - https://tailwindcss.com/docs/upgrade-guide#configure-content-sources

If I build another time with cache in .nuxt, this warning disappears and no issue occurs.

kingyue737 avatar Jul 11 '24 09:07 kingyue737

This is due to how the @nuxtjs/tailwindcss module works since https://github.com/nuxt-modules/tailwindcss/releases/tag/v6.12.0. We've been having lots of issues with this..

benjamincanac avatar Jul 11 '24 09:07 benjamincanac

Thanks for pointing out this. Maybe we can close this and track at https://github.com/nuxt-modules/tailwindcss/issues/855 ? Since we have workarounds mentioned above.

kingyue737 avatar Jul 11 '24 09:07 kingyue737

As @kingyue737 mentioned, a nuxt prepare is required so you can add a postinstall script in your package.json like: https://github.com/nuxt-ui-pro/docs/blob/main/package.json#L10

benjamincanac avatar Jul 11 '24 14:07 benjamincanac