You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After running astro add astro-single-file and attempting to run dev or build I get the following error (missing dependency?)
08:48:51 PM [astro] Unable to load /home/projects/nbwiabryp.github/astro.config.mjs
error Cannot find package 'html-minifier-terser' imported from /home/projects/nbwiabryp.github/node_modules/astro-single-file/index.js
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'html-minifier-terser' imported from /home/projects/nbwiabryp.github/node_modules/astro-single-file/index.js
at InternalError.get (https://nbwiabryp--github.w.staticblitz.com/blitz.912cb019f8b62040b90085f00ac69aca69f51e29.js:6:292489)
at instantiateModule (file:///home/projects/nbwiabryp.github/node_modules/vite/dist/node/chunks/dep-4da11a5e.js:53495:15)
Did it from scratch on stack blitz and ran into the same issue, here's the full log of what I ran (also double checked that the astro config file did get updated)
~/projects/nbwiabryp.github 2s
❯ astro add astro-single-file
⚠ astro-single-file is not an official Astro package. Use at your own risk!
✔ Continue? … yes
✔ Resolving with third party packages...
Astro will run the following command:
If you skip this step, you can always run it yourself later
╭────────────────────────────────╮
│ npm install astro-single-file │
╰────────────────────────────────╯
✔ Continue? … yes
✔ Installing dependencies...
Astro will make the following changes to your config file:
╭ astro.config.mjs ─────────────────────────────╮
│ import { defineConfig } from 'astro/config'; │
│ │
│ // https://astro.build/config │
│ import singleFile from "astro-single-file"; │
│ │
│ // https://astro.build/config │
│ export default defineConfig({ │
│ integrations: [singleFile()] │
│ }); │
╰───────────────────────────────────────────────╯
✔ Continue? … yes
success Added the following integration to your project:
- astro-single-file
~/projects/nbwiabryp.github 16s
❯ astro dev
08:48:51 PM [astro] Unable to load /home/projects/nbwiabryp.github/astro.config.mjs
error Cannot find package 'html-minifier-terser' imported from /home/projects/nbwiabryp.github/node_modules/astro-single-file/index.js
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'html-minifier-terser' imported from /home/projects/nbwiabryp.github/node_modules/astro-single-file/index.js
at InternalError.get (https://nbwiabryp--github.w.staticblitz.com/blitz.912cb019f8b62040b90085f00ac69aca69f51e29.js:6:292489)
at instantiateModule (file:///home/projects/nbwiabryp.github/node_modules/vite/dist/node/chunks/dep-4da11a5e.js:53495:15)
The text was updated successfully, but these errors were encountered:
Like you, I installed html-minifier-terser separately and it seems to work on macOS.
This plugin does only seem to work for single pages only i.e. a website with a nested route will not inline the CSS correctly. Astro intend to support inlining CSS natively: withastro/roadmap#556
After running
astro add astro-single-file
and attempting to run dev or build I get the following error (missing dependency?)Did it from scratch on stack blitz and ran into the same issue, here's the full log of what I ran (also double checked that the astro config file did get updated)
The text was updated successfully, but these errors were encountered: