Giter Club home page Giter Club logo

nextjs-course-code's People

Contributors

maxschwarzmueller 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  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

nextjs-course-code's Issues

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]

I think this course repo needs to be updated in other to work smoothly with next13 and react18 because I have been running into constant try to get starter-code up and running

Canot read properties of undefind (reading 'replace')

error - components\events\event-item.js (17:36) @ EventItem
TypeError: Cannot read properties of undefined (reading 'replace')
15 | year: 'numeric',
16 | });

17 | const formattedAddress = location.replace(', ', '\n');
| ^
18 | const exploreLink = /events/${id};
19 |
20 | return (

Getting error in starting project: ERR_PACKAGE_PATH_NOT_EXPORTED

Getting lots of errors after cloning the starter project and running npm install and then npm run dev

chinmaysarupria@Chinmays-MacBook-Pro nextjs-course-code % npm install

added 342 packages, and audited 343 packages in 7s

52 packages are looking for funding
  run `npm fund` for details

18 vulnerabilities (8 moderate, 9 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
chinmaysarupria@Chinmays-MacBook-Pro nextjs-course-code % npm run dev

> [email protected] dev
> next dev

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/parser' is not defined by "exports" in /Users/chinmaysarupria/nextapps/nextjs-course-code/node_modules/postcss/package.json
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:683:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.552 (/Users/chinmaysarupria/nextapps/nextjs-course-code/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11590)
    at __nccwpck_require__ (/Users/chinmaysarupria/nextapps/nextjs-course-code/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
    at Object.270 (/Users/chinmaysarupria/nextapps/nextjs-course-code/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:400)
    at __nccwpck_require__ (/Users/chinmaysarupria/nextapps/nextjs-course-code/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
    at Object.327 (/Users/chinmaysarupria/nextapps/nextjs-course-code/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:260)
    at __nccwpck_require__ (/Users/chinmaysarupria/nextapps/nextjs-course-code/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
    at Object.845 (/Users/chinmaysarupria/nextapps/nextjs-course-code/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:3733) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Arrow Functions?

Amazing course. Just curious why you always use regular functions instead of arrow functions? I know practically there isn't any difference, but just curious why you opt not to use arrow functions. Most of the code I see nowadays pretty much only uses arrow functions. Thanks.

file system

I have a problem with fs. It is "module not found: Can't resolve "fs""
i think my app can't read fs. please if you have a time, send me an answer.

I cloned and wrote npm i. after that this problem appeared

useSWR issue #2

I'm finding that, even though I've gone through the npm install swr command twice, I'm getting an error for ./pages/events/[..slug].js. The error says Attempted import error: 'useSWR' is not exported from 'swr'
useSWR_error
.

MongoDb

Hi,
While I try to database MongoDB I got a lot of error

reason: TopologyDescription {
type: 'ReplicaSetNoPrimary',
servers: Map(1) { '127.0.0.1:27017' => [ServerDescription] },
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: 'rs0',
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined,
page: '/api/comments/[eventId]',
[Symbol(errorLabels)]: Set(0) {}

How can I fix this?

ERROr

These type of error is occuring after adding buttons
Screenshot (142)
Please tell me how to resolve it.

React Update v5 to v6

Instead of '' it is easier to use '' tag with 'element' prop within the tag. It makes it clear and easy to understand.

Thanks for the Next.js course, it helped a lot.

Code will not compile at Lesson 190. Cannot continue

Hello:

In Lesson 190, once I add the line of code:

const postData = getPostData(slug);

Immediately I'm getting an 'ERR_REQUIRE_ESM' that keeps looping in the terminal. I have copied the code from [slug].js and posts-util.js from your nextjs-course-code on github into my project to make sure I didn't code something wrong and I'm still getting this looping error in the terminal. This is what the error looks like:

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\NextJS_Work\nextjs-course-code-full-blog\node_modules\react-markdown\index.js
require() of ES modules is not supported.
require() of C:\NextJS_Work\nextjs-course-code-full-blog\node_modules\react-markdown\index.js from C:\NextJS_Work\nextjs-course-code-full-blog.next\server\pages\posts[slug].js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\NextJS_Work\nextjs-course-code-full-blog\node_modules\react-markdown\package.json.
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.react-markdown (C:\NextJS_Work\nextjs-course-code-full-blog.next\server\pages\posts[slug].js:1157:18)
at webpack_require (C:\NextJS_Work\nextjs-course-code-full-blog.next\server\pages\posts[slug].js:23:31)
at Module../component/posts/post-detail/post-content.js (C:\NextJS_Work\nextjs-course-code-full-blog.next\server\pages\posts[slug].js:140:72)
at webpack_require (C:\NextJS_Work\nextjs-course-code-full-blog.next\server\pages\posts[slug].js:23:31)
at Module../pages/posts/[slug].js (C:\NextJS_Work\nextjs-course-code-full-blog.next\server\pages\posts[slug].js:1020:99)
at webpack_require (C:\NextJS_Work\nextjs-course-code-full-blog.next\server\pages\posts[slug].js:23:31)
at C:\NextJS_Work\nextjs-course-code-full-blog.next\server\pages\posts[slug].js:91:18
at Object. (C:\NextJS_Work\nextjs-course-code-full-blog.next\server\pages\posts[slug].js:94:10)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32) {
code: 'ERR_REQUIRE_ESM'

When I comment out that line of code that calls getPostData(slug) - which I know we do not want to do - the ERR_REQUIRE_ESM looping error stops but then I see this error in the terminal:

error - ./lib/posts-util.js:1:0
Module not found: Can't resolve 'fs'

1 | import fs from "fs";

I am using VS Code version 1.63.2.
I tried and I do not know how to get around this. Can you or somebody please help me with this error? I can no longer continue with this course until I can get around this issue, and I would really like to complete this course.

Thank you

Starting project

I converted the final code to starting project code and updated the dependencies. One thing to care of is next-auth change some of the import like useSession is now in 'next-auth/react' (before 'next-auth/client')

Here is the link to starting project

useSWR issue

When you use useSWR hook loading takes forever.

ERR_PACKAGE_PATH_NOT_EXPORTED

facing below error while try to run this command npm run dev
node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:3733) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'

05-prj-data-fetching useRouter Issue

Hello, nice course, but there seems to be an issue with useRouter on pages/events/[...slug].js

Sometimes router.query.slug is an empty object and not only in pre-rendering phase. Especially wenn hitting enter instead of reloading the page.

To make sure not having any errors in my code I copied source code from your repo and changed the firebase url to my project.
I still get this error
image

I already did some research on this topic and tried to avoid this error by using 'router' Object in a useEffect without success. Using
useRouter().isReady as dependency did not work also. All in all quite unpredictable behaviour.

Also changed from "swr": "^2.2.1" to "swr": "^2.0.0" without success.
And also installed prj-05-data-fetching from this repository. Hitting enter a few times also leads to the described error.

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.