andreinwald / uri-js-replace

Replacement for abandoned library uri-js aka URI.js: based on standard js URL and without punycode dependency
7 stars 0 forks source link

Not working for yarn based project #3

Closed Mon-ius closed 2 weeks ago

Mon-ius commented 2 weeks ago

Steps:

corepack enable && corepack prepare yarn@stable --activate

yarn create next-app fuck-eslint --ts --use-yarn --eslint --tailwind --no-app --import-alias="@/*" --src-dir

cd fuck-eslint && yarn dlx @yarnpkg/sdks vscode && yarn add three && yarn add -D @types/three

yarn install && yarn up && yarn dev

Then applied in package.json with:

{
  "name": "fuck-eslint",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "14.2.6",
    "react": "^18",
    "react-dom": "^18",
    "three": "^0.167.1"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "@types/three": "^0.167.2",
    "eslint": "^8",
    "eslint-config-next": "14.2.6",
    "postcss": "^8",
    "tailwindcss": "^3.4.1",
    "typescript": "^5"
  },
  "overrides": {
    "uri-js": "npm:uri-js-replace"
  },
  "packageManager": "yarn@4.4.0+sha512.91d93b445d9284e7ed52931369bc89a663414e5582d00eea45c67ddc459a2582919eece27c412d6ffd1bd0793ff35399381cb229326b961798ce4f4cc60ddfdb"
}

Run,

yarn install && yarn up && yarn dev

Still show:

  ▲ Next.js 14.2.6
  - Local:        http://localhost:3000

 ✓ Starting...
 ✓ Ready in 2.3s
 ○ Compiling / ...
(node:78122) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
 ✓ Compiled / in 2.6s (290 modules)
 ✓ Compiled in 144ms (290 modules)
andreinwald commented 2 weeks ago

Have you tried "yarn upgrade" or delete node_modules folder?

Mon-ius commented 2 weeks ago

we use Yarn 4.4 instead of Yarn 1.x, so yarn upgrade here is yarn up according to cli-changes

For details:

❯ yarn -v
4.4.0
Mon-ius commented 2 weeks ago

@andreinwald any progress?

Mon-ius commented 2 weeks ago

Okay, I found the solution that,

replace

  "overrides": {
    "uri-js": "npm:uri-js-replace"
  },

with

  "overrides": {
    "uri-js": "yarn:uri-js-replace"
  },

For guys who use yarn v4.x Cheers🤗

andreinwald commented 2 weeks ago

Thanks! Will add it to readme