mschwarzmueller / nextjs-course-code

Source code for my NextJS course (https://acad.link/nextjs)
1.43k stars 2.32k forks source link

Error [ERR_PACKAGE_PATH_NOT_EXPORTED] #41

Open ezeamaka2 opened 1 year ago

ezeamaka2 commented 1 year ago

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

jbdura commented 1 year ago

Have you managed to run your work? If so, what was the solution?

ezeamaka2 commented 1 year ago

I rewrote everything from scratch

andseipa commented 1 year ago

Had the same problem. Basically updated all the packages to the latest versions. No idea how that will affect the course material.

ezeamaka2 commented 1 year ago

After Updating all the packages, did it work?

vitalik-prog commented 1 year ago

I also faced with this problem. Nothing helped even upgrading all of the packages to the latest versions. So I deployed it to Netlify. On Netlify the project works fine except some small issues.

diegoperesgarcia commented 1 year ago

I had the same issue here. I fixed changing version of dependencies in package.json.

Before: "dependencies": { "next": "10.0.6", "react": "17.0.1", "react-dom": "17.0.1" }

After: "dependencies": { "next": "13.2.4", "react": "18.2.0", "react-dom": "18.2.0" }

Edit: Remember delete package-lock.json and the folder node_modules. After this run 'npm i' again.

vitalik-prog commented 1 year ago

Hihi! Interesting thing. I also tried to do the same. But unfortunately it didn't help. My current versions of dependencies which I couldn't manage to start on Vercel looks like: I see that they are similar to yours.

"dependencies": { "gray-matter": "^4.0.3", "mongodb": "^5.1.0", "next": "^13.2.4", "react": "^18.2.0", "react-dom": "^18.2.0", "react-markdown": "^8.0.5", "react-syntax-highlighter": "^15.5.0" }

ср, 15 бер. 2023 р. о 16:06 Diego Peres Garcia @.***> пише:

I had the same issue here. I fixed changing version of dependencies in package.json.

Before: "dependencies": { "next": "10.0.6", "react": "17.0.1", "react-dom": "17.0.1" }

After: "dependencies": { "next": "13.2.4", "react": "18.2.0", "react-dom": "18.2.0" }

— Reply to this email directly, view it on GitHub https://github.com/mschwarzmueller/nextjs-course-code/issues/41#issuecomment-1470073347, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASNU5TN465YJ5D4HSW7SMNTW4HEFBANCNFSM6AAAAAAUTMLGUA . You are receiving this because you commented.Message ID: @.***>

vitalik-prog commented 1 year ago

I had the same issue here. I fixed changing version of dependencies in package.json.

Before: "dependencies": { "next": "10.0.6", "react": "17.0.1", "react-dom": "17.0.1" }

After: "dependencies": { "next": "13.2.4", "react": "18.2.0", "react-dom": "18.2.0" }

Edit: Remember delete package-lock.json and the folder node_modules. After this run 'npm i' again.

P.s. Thanks a lot for your help. It has been fixed. The main point which I skipped is - "delete package-lock.json". After deleting package-lock.json all came to the right place and the project was deployed successfully.

ahmet-kok commented 1 year ago

I deleted package-lock.json, and node_modulesI used this command and fixed.

npm i next@latest react@latest react-dom@latest eslint-config-next@latest

I used the default package.json:

{
  "name": "nextjs-course",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"
  },
  "dependencies": {
    "eslint-config-next": "^13.3.0",
    "next": "^13.3.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  }
}
archit-io commented 1 year ago

I downloaded and installed nvm (node version manager). And then in my project I downgraded the node version to 16.14.2 (from 18.) using the command: nvm use 16.14.2

After the above change the error has gone and it's working for me.