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

[Bug?]: start-cloudflare-pages build fails with Vite 5 #1134

Closed
2 tasks done
asterikx opened this issue Dec 7, 2023 · 2 comments
Closed
2 tasks done

[Bug?]: start-cloudflare-pages build fails with Vite 5 #1134

asterikx opened this issue Dec 7, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@asterikx
Copy link

asterikx commented Dec 7, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Reposting solidjs/vite-plugin-solid#127 (comment)

I'm getting errors from vite:define in solid-start-cloudflare-pages@0.3.10 with Vite 5:

user@MBP my-project % pnpm build

> my-solid-app@0.1.0 build /Users/user/my-project
> solid-start build

 solid-start build 
 version  0.3.10
(node:93293) ExperimentalWarning: The Ed25519 Web Crypto API algorithm is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
 adapter  cloudflare-pages

solid-start building client...
vite v5.0.4 building for production...
✓ 4 modules transformed.
[vite:define] Transform failed with 1 error:
error: Invalid define value (must be an entity name or valid JSON syntax): (() => {})
file: /Users/user/my-project/node_modules/.pnpm/solid-start@0.3.10_@solidjs+meta@0.29.1_@solidjs+router@0.9.1_solid-js@1.8.6_solid-start-clou_ykgf2egikbvfaqjxxzhhreqmsa/node_modules/solid-start/entry-client/mount.tsx
🐼 error [❌] Transform failed with 1 error:
error: Invalid define value (must be an entity name or valid JSON syntax): (() => {})

Expected behavior 🤔

Successful build.

Steps to reproduce 🕹

Steps:

Context 🔦

No response

Your environment 🌎

No response

@asterikx asterikx added the bug Something isn't working label Dec 7, 2023
@asterikx asterikx changed the title [Bug?]: start-cloudflare-pages [Bug?]: start-cloudflare-pages build fails with Vite 5 Dec 7, 2023
@ryansolid
Copy link
Member

In setting up for SolidStart's next Beta Phase built on Nitro and Vinxi we are closing all PRs/Issues that will not be merged due to the system changing. If you feel your issue was closed by mistake. Feel free to re-open it after updating/testing against 0.4.x release. Thank you for your patience.

See #1139 for more details.

@chin2km
Copy link

chin2km commented Jan 2, 2024

@ryansolid this might not be related, but I couldn't find any updated documentation for setting up deployments of a solid app to Cloudflare Pages.

There is one documentation at https://docs.solidjs.com/guides/how-to-guides/deployment/deploying-to-cloudflare
And one here: https://start.solidjs.com/api/vite#configuring-your-application
There is one on Cloudflare Pages itself: https://developers.cloudflare.com/pages/framework-guides/deploy-a-solid-site/#solidstart-cloudflare-configuration

I have this in my vite.config.ts

import { defineConfig } from '@solidjs/start/config';

export default defineConfig({
  start: {
    server: {
      preset: 'cloudflare_module',
      rollupConfig: {
        external: ['__STATIC_CONTENT_MANIFEST', 'node:async_hooks'],
      },
    },
  },
});

and in the Cloudflare pages Build configurations, the "Build output directory" is configured to /.output since this is the folder I see when building the project locally.
There is also a .vinxi/build folder generated. Tried setting the "Build output directory" to either of that but to no avail.
Could you please point what's wrong in the configuration or point me to the docs.

Screenshot 2024-01-02 at 17 58 00

deps:

  "dependencies": {
    "@solidjs/router": "^0.10.5",
    "@solidjs/start": "^0.4.2",
    "autoprefixer": "^10.4.14",
    "postcss": "^8.4.26",
    "solid-js": "^1.8.7",
    "tailwindcss": "^3.3.3",
    "vinxi": "0.0.59"
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants