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?]: todomvc app doesn't work on vercel #1239

Closed
2 tasks done
albertoforni opened this issue Jan 10, 2024 · 6 comments
Closed
2 tasks done

[Bug?]: todomvc app doesn't work on vercel #1239

albertoforni opened this issue Jan 10, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@albertoforni
Copy link
Contributor

albertoforni commented Jan 10, 2024

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

I cloned the todomvc app from the examples folder and tried to deploy it to vercel using the preset in vite.config.ts

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

export default defineConfig({
  start: {
    server: {
      preset: "vercel",
    },
  },
});

In Build & Development Settings, I tried to override the different settings and specify Other Framework with no luck.
image

When I load the page I get this error in the console
image

Expected behavior 🤔

No response

Steps to reproduce 🕹

Steps:

  1. Clone the repo https://github.com/albertoforni/solidstart-todomvc
  2. Deploy to vercel
  3. Open the page

Context 🔦

No response

Your environment 🌎

solid-start: 0.4.6
@albertoforni albertoforni added the bug Something isn't working label Jan 10, 2024
@lxsmnsyc
Copy link
Member

lxsmnsyc commented Jan 10, 2024

This seems to be an issue to the app itself rather than the preset

https://github.com/solidjs/solid-start/blob/main/examples/todomvc/src/routes/index.tsx#L50-L56

todo() here can be undefined

@albertoforni
Copy link
Contributor Author

It seems to have a default value and it works locally.

@edivados
Copy link
Contributor

Does that driver work on vercel?

// this uses file system driver for unstorage that works only on node.js
// swap with the key value of your choice in your deployed environment
const storage = createStorage({
driver: fsLiteDriver({
base: "./.data"
})
});

@ryansolid
Copy link
Member

Yeah if I was to bet the problem is with the storage option. It probably isn't finding the todos properly.

@albertoforni
Copy link
Contributor Author

Thanks, I'll try to change that and see if it works.

@albertoforni
Copy link
Contributor Author

I confirm that by replacing

const storage = createStorage({
  driver: fsLiteDriver({
    base: "./.data"
  })
});

with a simple Map, it works.

Thanks everyone for the help and sorry for the noise.
I was trying to debug another project I'm migrating from v0.3.10 and I wanted to see if a simple example worked. I guess I picked a not-so-simple one... At least now I know that it does work.

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

4 participants