Giter VIP home page Giter VIP logo

issue-tracker's People

Contributors

mosh-ham 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar

issue-tracker's Issues

Use `Array.from(params).length` instead of `params.size` in IssueStatusFilter

Summary

If Issue Tracker is accessed from a safari browser (of version < 17) the Issue status filter is broken & hence would not filter the issues by their status, neither sort them by a particular column.

Why is this happening?
Inside the callback method of Issue Status Filter's onValueChange, the size property is used to check if there are any Url search params or not.

const query = params.size ? '?' + params.toString() : '';
router.push('/issues/list' + query);

The problem is that UrlSearchParams.size property is not widely supported on Safari browsers. The size property was only recently supported on Safari version 17 of both iOS & Mac which was released on 26-09-2023, according to MDN. This is also around the time when this course was being recorded.

As per the usage table of browser versions globally by caniuse.com only 16% of users have Safari version 17 & above, rest of the users are using version 16 or below.

In short, there is a lack of browser support for this property on current & older safari browsers, causing potential issues for those who try to access this Issue Tracker on their Safari.

Proposed solution

The proposed solution is to use this code:

        const query = Array.from(params.size).length ? '?' + params.toString() : '';
        router.push('/issues/list' + query);

Or we could just call the toString() method first & only router push if string isn't a falsey value.

And then give a advisory to students on this lecture's description https://members.codewithmosh.com/courses/nextjs-projects-issue-tracker/lectures/49642661 to modify their code if the Issue Status Filter is not working on their browser.

Thank you if you consider this proposal.
@mosh-hamedani

Hey Mosh

I learned next.js from this course Thank you. What i have learned in this course now I'm able to build and create my own applications, I'm now working on a open source projects inspire by many, one of them is this project manager please check it out. and give me your review. I put everything in it what i have learned from you. :) your comment on it will make my day. ๐Ÿ‘

not able to create the session

mosh, as per the Prisma schema I made the updation in it, though I am not able to have a session in the app , after going through the data grip as well the other DB tables are populated such as User db table and Account db Table there is no value in session db table due to which if try to signup with google Oauth services, the users is perfectly authenticated but i can't see the session going on.

PLEASE GUIDE ME TO RESOLVE THIS ISSUE
image
image

Unhandled Runtime Error

Typing any params(string) after
https://issue-tracker-pied.vercel.app/issues/
sends unnecessary fetch request to database resulting runtime error as intParse fails in

app\issues[id]\page.tsx
fetchUser(parseInt(params.id));

Simple solution: Check before database call

export async function generateMetadata({ params }: Props) {
  if (isNaN(parseInt(params.id))) notFound();
  const issue = await fetchUser(parseInt(params.id));

Error Encountered During Google Account Sign-In

I encountered an issue while attempting to sign in using my Google account via the login popup. The problem occurred after selecting one of my Google accounts, and I received the following error message: "Try signing in with a different account."

Error with creating the next.js project

This starts with creating the next.js project . Enter the terminal and navigate to where you want to create the project . And type npx [email protected].

Error: spawn UNKNOWN
at ChildProcess.spawn (node:internal/child_process:421:11)
at Object.spawn (node:child_process:761:9)
at spawn (C:\Users\RICHARD CONDUAH\AppData\Local\npm-cache_npx\3c25916de7007719\node_modules\create-next-app\dist\index.js:8:83670)
at C:\Users\RICHARD CONDUAH\AppData\Local\npm-cache_npx\3c25916de7007719\node_modules\create-next-app\dist\index.js:74:33779
at new Promise ()
at install (C:\Users\RICHARD CONDUAH\AppData\Local\npm-cache_npx\3c25916de7007719\node_modules\create-next-app\dist\index.js:74:33159)
at installTemplate (C:\Users\RICHARD CONDUAH\AppData\Local\npm-cache_npx\3c25916de7007719\node_modules\create-next-app\dist\index.js:74:38670)
at async createApp (C:\Users\RICHARD CONDUAH\AppData\Local\npm-cache_npx\3c25916de7007719\node_modules\create-next-app\dist\index.js:74:41469)
at async run (C:\Users\RICHARD CONDUAH\AppData\Local\npm-cache_npx\3c25916de7007719\node_modules\create-next-app\dist\index.js:74:50475) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'

next/navigation giving error: navigator is not defined

The page is redirected on form submission without going to the catch block. But, in the backend, I am getting the following error: the API body is not being executed.

For me, the Error does not go on server restart.

`"use client";
import { Button, TextField } from "@radix-ui/themes";
import SimpleMDE from "react-simplemde-editor";
import "easymde/dist/easymde.min.css";
import { useForm, Controller } from "react-hook-form";
import axios from "axios";
import { useRouter } from "next/navigation";

interface IssueInterface {
title: string;
description: string;
}

const NewIssue = () => {
const router = useRouter();
const { register, control, handleSubmit } = useForm();
return (
<form
className=" max-w-xl space-y-3"
onSubmit={handleSubmit(async (data) => {
try {
await axios.post("/issues/new", data);
router.push("/issues");
} catch (error) {
console.log(error);
}
})}
>
<TextField.Root>
<TextField.Input placeholder="Title" {...register("title")} />
</TextField.Root>
<Controller
name="description"
control={control}
render={({ field }) => (
<SimpleMDE placeholder="Description" {...field} />
)}
/>
Create Issue

);
};

export default NewIssue;`

Got application error after deploy on vercel

After I deploy issue-tracker on vercel, when I keep refreshing on list page/ issue detail page, I will get an error

Application error: a client-side exception has occurred (see the browser console for more information).
Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.

this error does not happed when I run npm run dev or npm run start

Error: P3009 occured while Deployment

This is the error message I found in logs


This works fine in development stage


Link to my Repository
migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
-- 10:51:22.825 | The `20240103141052_initial_migration` migration started at 2024-01-03 14:43:44.742 UTC failed

I tried many solutions as checking code and creating migration again but it didn't worked. Please help me fix this.

Object literal may only specify known properties, and 'assignedToUserId' does not exist in type

const updatedIssue = await prisma.issue.update({
where: { id: issue.id },
data: {
title,
description,
assignedToUserId,
},
});

Object literal may only specify known properties, and 'assignedToUserId' does not exist in type '(Without<IssueUpdateInput, IssueUncheckedUpdateInput> & IssueUncheckedUpdateInput) | (Without<...> & IssueUpdateInput)'.ts(2353)
index.d.ts(2083, 5): The expected type comes from property 'data' which is declared here on type '{ select?: IssueSelect | null | undefined; data: (Without<IssueUpdateInput, IssueUncheckedUpdateInput> & IssueUncheckedUpdateInput) | (Without<...> & IssueUpdateInput); where: IssueWhereUniqueInput; }'

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.