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

Vercel deployment doesn't work from fresh install #250

Open
csi-lk opened this issue Nov 23, 2024 · 5 comments
Open

Vercel deployment doesn't work from fresh install #250

csi-lk opened this issue Nov 23, 2024 · 5 comments

Comments

@csi-lk
Copy link

csi-lk commented Nov 23, 2024

(Strangely vercel dev does work though)

How to reproduce:

Setup new app

$ bunx one

Hello. Let's create a new ①  app...
✔ Name … test-one-vercel
✔ Template › Minimal Tamagui
⠦ Creating...
test-one-vercel created!
✔ Package Manager: › bun
Installing with bun...
[cut out this part]
bun install completed successfully.
Done! Created a new project under ./test-one-vercel
To run:
  cd test-one-vercel
  bun dev

$ cd test-one-vercel

Edit vite.config.ts plugins.one.web.deploy: "vercel"

Run vercel

$ vercel
Vercel CLI 39.1.1
? Set up and develop “~/dev/test-one-vercel”? yes
? Which scope should contain your project? my projects
? Link to existing project? no
? What’s your project’s name? test-one-vercel
? In which directory is your code located? ./
Local settings detected in vercel.json:
Auto-detected Project Settings (Vite):
- Build Command: vite build
- Development Command: vite --port $PORT
- Install Command: `yarn install`, `pnpm install`, `npm install`, or `bun install`
- Output Directory: dist
? Want to modify these settings? yes
? Which settings would you like to overwrite (select multiple)?
* Build Command: bunx one build
* Development Command: bunx one dev
🔗  Linked to test-one-vercel (created .vercel and added it to .gitignore)

📝  To deploy to production (test-one-vercel.vercel.app), run `vercel --prod

Go to URL provided and get HTML output of the index.js file - https://test-one-vercel.vercel.app

import { serve } from 'one/serve'
const handler = await serve()
export const { GET, POST, PUT, PATCH, OPTIONS } = handler

Any ideas on what I can do to get this to work?

If it helps I cloned the hono vercel starter and got that working fine

@sunxyw
Copy link

sunxyw commented Dec 8, 2024

any solutions? having this too

@natew
Copy link
Collaborator

natew commented Dec 17, 2024

looking at this today

@rommyarb
Copy link

I'm having this too.

My package.json:

{
  "name": "some-one",
  "version": "1.1.371",
  "private": true,
  "type": "module",
  "scripts": {
    "dev": "one dev",
    "dev:clean": "one dev --clean",
    "clean": "one clean",
    "prebuild:native": "one prebuild",
    "build:web": "one build",
    "serve": "one serve"
  },
  "installConfig": {
    "hoistingLimits": "workspaces"
  },
  "dependencies": {
    "expo": "~51.0.28",
    "one": "^1.1.371",
    "react": "^18.3.1",
    "react-native": "0.74.5",
    "react-native-reanimated": "~3.10.1",
    "react-native-safe-area-context": "4.10.5",
    "react-native-screens": "3.31.1",
    "react-native-web": "^0.19.12"
  },
  "devDependencies": {
    "@types/react": "^18.3.11",
    "vite": "^6.0.5"
  }
}

My vite.config.ts:

import { defineConfig } from "vite"
import { one } from "one/vite"

export default defineConfig({
  plugins: [
    one({
      web: {
        defaultRenderMode: "ssg",
        deploy: "vercel",
      },
      server: {
        platform: "vercel",
      },
    }),
  ],
})

I override my vercel build settings:
Screenshot 2024-12-25 at 22 51 11

@natew
Copy link
Collaborator

natew commented Dec 27, 2024

Yea so I went into this quite a bit, it seems we have to move to the build output API. I will continue to work on this.

@rommyarb
Copy link

PR #397

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

No branches or pull requests

4 participants