withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!

Home Page:https://astro.build

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build broken in Astro 4.11.6

wheresrhys opened this issue · comments

Astro Info

Astro                    v4.11.6
Node                     v18.20.4
System                   macOS (arm64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             @astrojs/starlight

I'm also seeing the issue in github actions, where I am unable to run `astro info`

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Some dependencies appear to be missing. See this build output https://github.com/wheresrhys/fetch-mock/actions/runs/9975537393/job/27565585726

What's the expected result?

When pinning to 4.11.5 I get a successful build https://github.com/wheresrhys/fetch-mock/actions/runs/9975667348/job/27565992625

Link to Minimal Reproducible Example

https://github.com/wheresrhys/fetch-mock/actions/runs/9975537393/job/27565585726

Participation

  • I am willing to submit a pull request for this issue.

I had a quick look at your action, and it seems that was triggered after you updated the package manager. Is it possible that some lock file wasn't updated? Or that the action is buggy? wheresrhys/fetch-mock@ffab4b6

I did update a repo of mine that relies on starlight with that latest of Astro and I didn't see any issue.

I had a quick look at your action, and it seems that was triggered after you updated the package manager. Is it possible that some lock file wasn't updated? Or that the action is buggy? wheresrhys/fetch-mock@ffab4b6

I did update a repo of mine that relies on starlight with that latest of Astro and I didn't see any issue.

I started new project and I'm having same issue with 4.11.6. On other hand 4.11.5 works fine.
windows 11
node 18/20
npm 9.6.7

{
  "name": "test",
  "type": "module",
  "version": "0.0.1",
  "scripts": {
    "dev": "astro dev",
    "start": "astro dev",
    "build": "astro check && astro build",
    "preview": "astro preview",
    "astro": "astro"
  },
  "dependencies": {
    "@astrojs/check": "^0.8.2",
    "@astrojs/mdx": "^3.1.2",
    "@astrojs/rss": "^4.0.7",
    "@astrojs/sitemap": "^3.1.6",
    "astro": "^4.11.6",
    "typescript": "^5.5.3"
  }
}

> astro dev

SyntaxError: Unexpected token 'with'
    at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14)
commented

There is an an actual regression, this version of Astro introduces an import attribute somewhere (possibly in a dep?), which are not supported on low versions of Node 18 and 20.

Upgrading your Node version will fix this.

Just encountered this with Cloudflare Pages hosting, since their most current build configuration still uses Node 18.17

Setting an environment variable NODE_VERSION value 22.4 got builds working again.

Building also fails on Bun v1.1.20 on Cloudflare Pages.
v1.1.20 is the latest version of Bun.

Memo:
sindresorhus/boxen#97
https://github.com/sindresorhus/cli-boxes/blob/86a3c71c6060fd338a817b78ef16bae3ff28afac/index.js#L1

For anyone coming here, the next release (4.12.0) will fix it.