-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloudflare Adapter unable to resolve node:fs
#6529
Comments
I'm pretty sure this is because we are using |
Ah, never mind. The example does use the experimental assets. This feature doesn't yet work outside of Node.js. So you can't use it with the Cloudflare adapter. |
@Princesseuh is going to add a warning about using the service, and that's it's only available in Node.js. @Princesseuh personally I think just a simple warning on every dev / build startup that says "Experimental assets support is only available for Node.js runtimes", or something like that. |
That would make sense, so I took out the |
@matthewp I'm still receiving the error even when the experimental assets aren't being used. My config now looks like this:
|
@jackcarey yep, we found a place where that code was being mistakenly imported,when using content collections, and the fix will be released shortly. |
The update for |
Consider trying out the new This worked for me. I am using Cloudflare Pages and the Cloudflare Adapter with |
not work above sol |
@james2doyle 's solution doesn't work for me either. There are apparently libraries that the experimental assets use that are not handled by the nodejs_compat layer. However, this workaround works for limited use cases: #4109 (comment) |
I'm still getting build errors:
|
I am seeing this same problem in Astro v3.2.3. I am using the AstroWind theme and I am seeing the error even on some plaintext pages for privacy and terms & conditions. Possibly because I am importing a picture for the logo from the Assets directory. |
Still getting this in 3.5.3 using the cloudflare adapter. |
Have you found any working solution? I'm using Astro |
Ok, so I eventually got it working. I can't remember exactly what I ended up doing. But here is what I am seeing in my code from December. package.jsondependencies: devDependencies: astro.config.mjsimport cloudflare from "@astrojs/cloudflare"; // Updates to config I think the hybrid part was crucial. |
I did upgrade to Astro 4 a few weeks ago. Below are the versions I now have for each package. "@astrojs/cloudflare": "^9.0.0", As you can see, I only needed to update the first package. If you want I can post a full copy of my package.json. |
Thanks for sharing @pthurmond-vmlyr |
Ok, I have added my config and my package.json to a Github Gist. https://gist.github.com/pthurmond-vmlyr/bdbeebefbdebdabaae85a079f310031a I can add more files to that if you need it. |
FYI, I upgraded my site to the latest version of the Cloudflare adapter (v11.x) and my site no longer works with the Cloudflare adapter. This is being tested in a separate branch mind you. Local testing just requires using the It does work with my previously stated version of the adapter (9.x).
I don't yet have a solve for it, but I think the cloudflare adapter may need more work. I do see a related ticket though. |
I should add that the 10.x version also fails to work. |
iam using 11.0.4 v but still same error |
still same error
|
What version of
astro
are you using?2.1.2
Are you using an SSR adapter? If so, which one?
Cloudflare v6.2.0
What package manager are you using?
npm
What operating system are you using?
Windows & CF Workers
What browser are you using?
Chrome
Describe the Bug
output: "static"
, the site builds and can be previewed, except I am obviously missing the Cloudflare functions I'm developing.astro dev
with the CF adapter andoutput: "server"
the site builds and loads correctly in my browser.astro build --verbose
, the build fails both locally and when pushing to CF Pages, with errors about built-in node modules that couldn't be found and warnings about packages being marked withsideEffects: false
.advanced
, to no avail.-My repo is private for now, but I can make it public if necessary.
Here's the info I think is needed:
and the error I am receiving:
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-5gayx2
Participation
The text was updated successfully, but these errors were encountered: