Giter Site home page Giter Site logo

Comments (4)

alexanderniebuhr avatar alexanderniebuhr commented on July 17, 2024

Issue happens with Cloudflare & Node.. So no adapter specific issue.

from astro.

ematipico avatar ematipico commented on July 17, 2024

cc @bholmesdev

from astro.

bholmesdev avatar bholmesdev commented on July 17, 2024

Hi @hkbertoson, thanks for reporting! I see you're using the Cloudflare adapter. Did you try the following?

  1. Add the nodejs_als flag to your wrangler config. This allows a Node-specific API that actions relies on
# wrangler.toml
compatibility_flags = [ "nodejs_als" ]
  1. Mark this Node API as external in your vite config:
import {defineConfig} from "astro/config";
import cloudflare from '@astrojs/cloudflare';

export default defineConfig({
  adapter: cloudflare({}),
  output: 'server',
  vite: {
    ssr: {
      external: ['node:async_hooks'],
    },
  },
})

I was also unable to reproduce this bug with the node adapter as @alexanderniebuhr noted above. If you can share a minimal reproduction with the node adapter that displays this issue, please share!

from astro.

alexanderniebuhr avatar alexanderniebuhr commented on July 17, 2024

@bholmesdev I just took that assumption based on screenshots from here https://discord.com/channels/830184174198718474/1255555330646216785

That thread shows that the Cloudflare specific issue can be fixed with the solution you posted but that then the same error as node appears. I think it might be an issue on how it is used in this specific case.

from astro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.