#Upgrade errors

76 messages · Page 1 of 1 (latest)

charred scroll
#

Getting the following errors when starting Astro server after upgrading from 5.18 to 6.0.4. I use pnpm.

Cannot find module '/home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/tinyexec/dist/main.js' imported from /home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/astro/dist/cli/exec.js
  Stack trace:
    at finalizeResolution (node:internal/modules/esm/resolve:275:11)
    at defaultResolve (node:internal/modules/esm/resolve:985:11)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:182:49)
 ELIFECYCLE  Command failed with exit code 1.
ruby lava
#

It seems there was a temporary issue with tinyexec, they just published a new version! Can you try again?
See #framework message

charred scroll
#

Should I do clean-install?

ruby lava
#

You could try running pnpm i to see if it fetches a more recent version of tinyexec while install. Other you could try to upgrade your packages again pnpm up --latest.

charred scroll
#

Alright, fresh install. Now, this error:

The provided Wrangler config main field (/home/rafi/khalids-shell/dist/_worker.js/index.js) doesn't point to an existing file
  Location:
    /home/rafi/khalids-shell/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected]_wrangler@_hyz7qzegdkabb2xeqwcxpwm2qm/node_modules/@cloudflare/vite-plugin/dist/index.mjs:14490:44
  Stack trace:
    at maybeResolveMain (file:///home/rafi/khalids-shell/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected]_wrangler@_hyz7qzegdkabb2xeqwcxpwm2qm/node_modules/@cloudflare/vite-plugin/dist/index.mjs:14490:44)
    at resolveWorkerConfig (file:///home/rafi/khalids-shell/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected]_wrangler@_hyz7qzegdkabb2xeqwcxpwm2qm/node_modules/@cloudflare/vite-plugin/dist/index.mjs:14572:9)
    at BasicMinimalPluginContext.config (file:///home/rafi/khalids-shell/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected]_wrangler@_hyz7qzegdkabb2xeqwcxpwm2qm/node_modules/@cloudflare/vite-plugin/dist/index.mjs:26792:33)
    at async resolveConfig (file:///home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/config.js:35438:13)
    at async createContainer (file:///home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/astro/dist/core/dev/container.js:68:22)
 ELIFECYCLE  Command failed with exit code 1.
paper jungle
#

@

#

Hi, are you using npm create cloudflare ? That Template hasn't been updated for Astro 6 yet, it's in the process of being so.

#

If you use npm create astro and then npx astro add cloudflare you shouldn't hit that problem.

charred scroll
#

No, mine is an existing project

paper jungle
#

Ok, what do you have in your wrangler.json/toml "main" field?

charred scroll
#

"main": "dist/_worker.js/index.js",

paper jungle
#

In this case, change to @astrojs/cloudflare/entrypoints/server

charred scroll
#

Now:

00:39:48 [ERROR] [vite] Internal server error: Network connection lost.
      at CustomModuleRunner.cachedModule (workers/runner-worker.js:1196:20)
      at request (workers/runner-worker.js:1123:83)
      at null.<anonymous> (/home/rafi/khalids-shell/node_modules/.vite/deps_ssr/@iconify-json_simple-icons.js:1:1)
      at Object.runInlinedModule (workers/runner-worker.js:1314:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1166:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1084:73)
      at null.<anonymous> (/home/rafi/khalids-shell/src/components/Icon.astro:3:1)
      at Object.runInlinedModule (workers/runner-worker.js:1314:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1166:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1084:73)
00:39:48 [vite] [vite] program reload
00:40:38 [ERROR] [vite] Internal server error: Network connection lost.
      at CustomModuleRunner.cachedModule (workers/runner-worker.js:1196:20)
      at request (workers/runner-worker.js:1123:83)
      at null.<anonymous> (/home/rafi/khalids-shell/node_modules/.vite/deps_ssr/@iconify-json_simple-icons.js:1:1)
      at Object.runInlinedModule (workers/runner-worker.js:1314:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1166:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1084:73)
      at null.<anonymous> (/home/rafi/khalids-shell/src/components/Icon.astro:3:1)
      at Object.runInlinedModule (workers/runner-worker.js:1314:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1166:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1084:73)

paper jungle
charred scroll
paper jungle
#

Cool website

charred scroll
#

Thx. Off-topic, btw...

mortal tinsel
#

I know iconify utils brings in CJS but they fixed it

charred scroll
#

After setting prerenderEnvironment. the server is running. But, a lot of WARNs:

01:03:21 [WARN] [vite] The file does not exist at "/home/rafi/khalids-shell/node_modules/.vite/deps/astro-FHTF34CJ.js?v=8d50e4f0" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
01:03:21 [WARN] [vite] The file does not exist at "/home/rafi/khalids-shell/node_modules/.vite/deps/audit-U6X3DSYQ.js?v=8d50e4f0" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
01:03:23 [WARN] [vite] The file does not exist at "/home/rafi/khalids-shell/node_modules/.vite/deps/xray-XSRL42K5.js?v=8d50e4f0" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
01:03:23 [WARN] [vite] The file does not exist at "/home/rafi/khalids-shell/node_modules/.vite/
twin acorn
#

Hi! I just followed the upgrade guide, nothing special. This might be a dependencies thing? But I've also never deployed the theme on Cloudflare, so no specififc adjustments I know of for that

#

If you end up finding something though, let me know

#

Maybe it can help others

charred scroll
twin acorn
charred scroll
#

Ok, I only asked about your theme, tho, not Astro

twin acorn
#

There's nothing else

#

It's just your local zod schemas

#

There's no packages or anything to update, and since you clone/copy the theme code you can't just install anything!

charred scroll
#

I mean I didn't follow with Spectre's updates after Aug. How can I update now? Will a simple git pull harm considering my modifications?

#

What changed since then?

twin acorn
#

You'll probably run into merge conflicts if you still have the theme linked to the git repo, which you'll have to resolve yourself. Though, if you want a rundown of the changes and follow that manually (which I think is faster):
https://github.com/louisescher/spectre/releases has an overview and links to the PRs

#

Basically:

  1. A grammar fix
  2. Canonical URL fix
  3. Astro is now at 6.0, with everything being upgraded according to the upgrade guide
charred scroll
charred scroll
#

I keep getting these errors when launching server:

12:48:03 [ERROR] [vite] 12:48:01 [ERROR] Error: Network connection lost.
    at CustomModuleRunner.cachedModule (workers/runner-worker.js:1196:20)
    at request (workers/runner-worker.js:1123:83)
    at /home/rafi/khalids-shell/node_modules/.vite/deps_ssr/@iconify-json_simple-icons.js:1:1
    at Object.runInlinedModule (workers/runner-worker.js:1314:4)
    at CustomModuleRunner.directRequest (workers/runner-worker.js:1166:59)
    at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1084:73)
    at /home/rafi/khalids-shell/src/components/Icon.astro:3:1
    at Object.runInlinedModule (workers/runner-worker.js:1314:4)
    at CustomModuleRunner.directRequest (workers/runner-worker.js:1166:59)
    at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1084:73)
#

Then, after some back and forth with these errors, the server launches

#

Even after launching, the error comes back to haunt me:

13:05:32 [ERROR] [vite] Internal server error: Network connection lost.
      at CustomModuleRunner.cachedModule (workers/runner-worker.js:1196:20)
      at request (workers/runner-worker.js:1123:83)
      at null.<anonymous> (/home/rafi/khalids-shell/node_modules/.vite/deps_ssr/@iconify-json_simple-icons.js:1:1)
      at Object.runInlinedModule (workers/runner-worker.js:1314:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1166:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1084:73)
      at null.<anonymous> (/home/rafi/khalids-shell/src/components/Icon.astro:3:1)
      at Object.runInlinedModule (workers/runner-worker.js:1314:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1166:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1084:73)
twin acorn
#

You could try upgrading the iconify json packages, maybe that helps

#

but no clue

charred scroll
#

Will removing astro cloudflare adapter fix these issues? I don't use SSR.

mortal tinsel
#

Also yes I think the issues you’re having are unique to the Cloudflare adapter

charred scroll
#
[vite] An error happened during full reload
Cannot split a chunk that has already been edited (0:76 – "import.meta")
Error: Cannot split a chunk that has already been edited (0:76 – "import.meta")
    at MagicString._splitChunk (file:///home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/config.js:3587:10)
    at MagicString._split (file:///home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/config.js:3578:43)
    at MagicString.update (file:///home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/config.js:3402:8)
    at onIdentifier (file:///home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/config.js:15503:75)
    at file:///home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/config.js:15615:37
    at Array.forEach (<anonymous>)
    at walk$1 (file:///home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/config.js:15614:14)
    at ssrTransformScript (file:///home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/config.js:15480:2)
    at async loadAndTransform (file:///home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/config.js:22701:64)
    at async fetchModule (file:///home/rafi/khalids-shell/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/config.js:33993:15)
#

And, I keep getting this:

09:27:13 [vite] 09:27:13 [404] /@id/astro/runtime/client/dev-toolbar/astro_runtime_client_dev-t

charred scroll
#

Another issue: images don't load in Cloudflare deployments now. The console says,

Failed to load resource: the server responded with a status of 404 ()

mortal tinsel
#

hmm

#

anyway you can push a branch the current code thats causing this?

mortal tinsel
#

so youre not using prerenderEnvironment node anymore?

charred scroll
#

No

#

Should I us eit?

mortal tinsel
#

no not neccessarily

#

just curious

#

this is on astro v5 still?

charred scroll
#

No, Astro 6

mortal tinsel
#

might need to push then

charred scroll
#

I did push, but Radicle needs to sync, too. As a new user, I forgot that.

#

W8

charred scroll
mortal tinsel
# charred scroll Updated now

i wasnt able to reproduce the other dev server errors, but i do see the 404 with images

is there anyway you could make an issue for output static images 404ing?

#

@stark crow I'll be gone for 2 weeks otherwise id help more

This project has output static but Cloudflare-biding replies on the image endpoint existing

charred scroll
#

I have removed the adapter

mortal tinsel
#

you can also use compile image service if you want to keep using the adapter sorry shouldve said that ealirer

charred scroll
#

FIne. I'm not using SSR now, so don't even need it. I was only considering SSR for future.

charred scroll
#

@twin acorn What does Spectre use node adapter for?

twin acorn
#

It's how I host the preview of the theme!

charred scroll
twin acorn
#

I host the CSS for the comments via the spectre preview deployment

#

And that needs to be SSRd

charred scroll
#

Giscus you mean?