Skip to content
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

Client Side Functionality not working properly in Cloudflare Adapter v10 while using Solidjs #272

Closed
1 task
ksjitendra18 opened this issue May 27, 2024 · 4 comments
Labels
needs triage Issue needs to be triaged

Comments

@ksjitendra18
Copy link

Astro Info

Astro                    v4.9.2
Node                     v20.11.0
System                   Windows (x64)
Package Manager          pnpm
Output                   server
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/tailwind
                         @astrojs/solid-js

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

No response

Describe the Bug

Functionality like onClick is not working. In network tab all the files loaded just perfectly fine. I have tried this in Chrome, Firefox, Brave latest version.

I have tried v10.0.3, 10.1.0, 10.2.6
Version:
"@astrojs/cloudflare": "^10.2.6",
"@astrojs/solid-js": "^4.2.0",
"@astrojs/tailwind": "^5.1.0",
"astro": "^4.9.2",
"solid-js": "^1.8.17",

Repo: https://github.com/ksjitendra18/astro-solid-repo
Live: https://astro-solid-repo.pages.dev/

On downgrading the version to v8 or v9 the functionality works completely fine

What's the expected result?

onClick to work and log to console which doesn't work in latest version

On downgrading to v8 or v9 it works.
Repo: https://github.com/ksjitendra18/astro-solid-repo/tree/dev
Live URL: https://c46d4cfd.astro-solid-repo.pages.dev/

Link to Minimal Reproducible Example

https://github.com/ksjitendra18/astro-solid-repo

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label May 27, 2024
@ksjitendra18 ksjitendra18 changed the title Client Side Functionality not working property in v10 while using Solidjs Client Side Functionality not working property in Cloudflare Adapter v10 while using Solidjs May 27, 2024
@ksjitendra18 ksjitendra18 changed the title Client Side Functionality not working property in Cloudflare Adapter v10 while using Solidjs Client Side Functionality not working properly in Cloudflare Adapter v10 while using Solidjs May 27, 2024
@matthewp matthewp transferred this issue from withastro/astro May 28, 2024
@jasperteo
Copy link

This is an ongoing issue with the Vite Plugin for Solid.

solidjs/vite-plugin-solid#153

One workaround is to change your astro.config.ts/astro.config.mjs right before the build step.

import { defineConfig } from "astro/config";
import cloudflare from "@astrojs/cloudflare";
import solidJs from "@astrojs/solid-js";

// Example config
export default defineConfig({
  integrations: [solidJs()],
  output: "server",
  adapter: cloudflare({
    platformProxy: { enabled: true },
    imageService: "passthrough",
  }),
  vite: {
    // Temporary workaround
     resolve: {
       conditions: ["worker", "webworker"],
       mainFields: ["module"],
     },
  },
});

Your experience may vary as this is not a perfect solution.

@alexanderniebuhr
Copy link
Member

Thanks, we're trying to work with the Solid team to resolve this. Duplicate of #224

@alexanderniebuhr alexanderniebuhr closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2024
@aurelius-coffee
Copy link

I had the same problem. In my case moving from <>...</> to <div>...</div> solved the issue. Maybe that can help you too @ksjitendra18

@ksjitendra18
Copy link
Author

ksjitendra18 commented Jun 6, 2024

I had the same problem. In my case moving from <>...</> to <div>...</div> solved the issue. Maybe that can help you too @ksjitendra18

This does fix the issue. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

4 participants