#'The "windows-1252" encoding is not supported' error on build

3 messages · Page 1 of 1 (latest)

lofty quartz
#

Hi all,
I am trying to make a minor CSS update to my Astro site, and want to run a build to test the output locally.

I updated Astro and other NPM packages today.
Astro is v5.7.9
NPM is 10.9.2

When I run npm run astro build I get the following output:

> [email protected] astro
> astro build

The "windows-1252" encoding is not supported
  Hint:
    Browser APIs are not available on the server.
    
    If the code is in a framework component, try to access these objects after rendering using lifecycle methods or use a `client:only` directive to make the component exclusively run on the client.
    
    See https://docs.astro.build/en/guides/troubleshooting/#document-or-window-is-not-defined for more information.
            
  Location:
    /volume2/web/testsite.com-astro/node_modules/fontkit/dist/module.mjs:5407:51
  Stack trace:
    at new NodeError (node:internal/errors:406:5)
    at new TextDecoder (node:internal/encoding:428:31)
    at ModuleJob.run (node:internal/modules/esm/module_job:217:25)
    at async runCommand (file:///volume2/web/testsite.com-astro/node_modules/astro/dist/cli/index.js:146:25)

I am guessing this is related to fonts somehow, but I am not sure what has changed as this was building successfully before. I am using 3 WOFF2 font files for this site, and a JS library is also loading a handful of fonts, including a WOFF, OTF and TTF.

From what I can tell, all my Astro files are encoded with UTF-8.

I have not enabled the experimental font API.

Any ideas?

night plank
#

CC @flat dust

flat dust
#

Impossible to tell without a repro to look at