Coder Social home page Coder Social logo

todoapp-supabase's Introduction

Hi there ๐Ÿ‘‹

๐Ÿข Iโ€™m currently working as a CEO and CTO in company named MTechZilla.

Sharvin's GitHub stats

๐Ÿ’ฌ You can ask me about:

  • JavaScript
  • TypeScript
  • React
  • NextJS
  • StoryBook
  • ExpressJS
  • Serverless
  • AWS
  • Firebase
  • Supabase
  • Stripe

๐Ÿค” If want to collaborate, you can reach out to me.

๐Ÿ“ซ How to reach me:

  • โœ‰๏ธ Email me at [email protected]
  • ๐Ÿ’ฌ Dm on twitter id @sharvinshah26

๐ŸŒ Go through my portfolio to know more about me.

todoapp-supabase's People

Contributors

sharvin26 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

todoapp-supabase's Issues

webSocket connection to 'wss//.....' failed:

First, thank you very much for sharing how to make todolist app in Next.js & supaBase, it help me a lot.

I'm not familiar with React and supaBase, here I have some issue when I followed your tutorial in freeCodeCamp,

I always get error in Chrome console like this
webSocket connection to 'wss//.....' failed:

and i think the error is from these code in index.js

useEffect(() => {
    const todoListener = supabaseClient
      .from("todos")
      .on("*", (payload) => {
        if (payload.eventType !== "DELETE") {
          const newTodo = payload.new;
          setTodos((oldTodos) => {
            const exists = oldTodos.find((todo) => todo.id === newTodo.id);
            let newTodos;
            if (exists) {
              const oldTodoIndex = oldTodos.findIndex(
                (obj) => obj.id === newTodo.id
              );
              oldTodos[oldTodoIndex] = newTodo;
              newTodos = oldTodos;
            } else {
              newTodos = [...oldTodos, newTodo];
            }
            newTodos.sort((a, b) => b.id - a.id);
            return newTodos;
          });
        }
      })
      .subscribe();

    return () => {
      todoListener.unsubscribe();
    };
  }, []);

but i have no idea to fix it....

because when I update todo or add new todo, it cannot show the new state for todos, i need refresh again to fetch new todos.

thank you.

Three items

Hi, really enjoyed this tutorial
I have this repo: https://github.com/coding-to-music/supabase-nextjs-todo-app
And the readme is the same as this issue: coding-to-music/coding-to-music.github.io#340

I have three items you might want to be aware of

  1. The directory components is plural, this sentence uses singular: "Create a component directory under the root directory, and inside the component directory"
  2. This mentions going up two levels, it probably is only one level? import { supabaseClient } from "../../lib/client";
  3. When I then attempt to do a build, I get the following error, not sure how to proceed?

https://github.com/coding-to-music/supabase-nextjs-todo-app/blob/main/README.md#how-to-deploy-the-app-to-vercel-and-configure-supabase-authentication

> build
> next build

info  - Loaded env from /mnt/ap/ap/supabase-nextjs-todo-app/.env.local
info  - Checking validity of types  
info  - Creating an optimized production build  
info  - Compiled successfully
info  - Collecting page data  
[    ] info  - Generating static pages (0/6)
Error occurred prerendering page "/auth". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: res.setHeader is not a function
    at GoTrueApi.setAuthCookie (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/@supabase/gotrue-js/dist/main/GoTrueApi.js:377:17)
    at handler (/mnt/ap/ap/supabase-nextjs-todo-app/.next/server/pages/auth.js:35:102)
    at d (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:33:498)
    at bb (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:16)
    at a.b.render (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:42:43)
    at a.b.read (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:83)
    at Object.exports.renderToString (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:52:138)
    at Object.renderPage (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/next/dist/server/render.js:686:46)
    at Object.defaultGetInitialProps (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/next/dist/server/render.js:316:51)
    at Function.getInitialProps (/mnt/ap/ap/supabase-nextjs-todo-app/.next/server/chunks/859.js:515:20)
info  - Generating static pages (6/6)

> Build error occurred
Error: Export encountered errors on following paths:
        /auth
    at /mnt/ap/ap/supabase-nextjs-todo-app/node_modules/next/dist/export/index.js:500:19
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Span.traceAsyncFn (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/next/dist/trace/trace.js:74:20)
    at async /mnt/ap/ap/supabase-nextjs-todo-app/node_modules/next/dist/build/index.js:987:17
    at async Span.traceAsyncFn (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/next/dist/trace/trace.js:74:20)
    at async /mnt/ap/ap/supabase-nextjs-todo-app/node_modules/next/dist/build/index.js:861:13
    at async Span.traceAsyncFn (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/next/dist/trace/trace.js:74:20)
    at async Object.build [as default] (/mnt/ap/ap/supabase-nextjs-todo-app/node_modules/next/dist/build/index.js:82:25)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.