valeriangalliat / fetch-cookie

Decorator for a `fetch` function to support automatic cookie storage and population. 🍪
The Unlicense
135 stars 29 forks source link

Post-install script prevents installation #76

Open leehambley opened 2 years ago

leehambley commented 2 years ago

I just leave this log here, but the type definitions prevent installation in my environment. TS config also included:

➜  fp-ra-client git:(main) ✗ yarn add https://github.com/leehambley/fetch-cookie --ignore-scripts

yarn add v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "ts-standard > @typescript-eslint/eslint-plugin@4.33.0" has unmet peer dependency "@typescript-eslint/parser@^4.0.0".
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
$ npm run build && npm run type-declarations

> fetch-cookie@2.1.0 build
> esbuild src/*.ts --format=esm --outdir=esm && esbuild src/*.ts --format=cjs --outdir=cjs

  esm/index.js  7.3kb

  cjs/index.js  8.4kb

> fetch-cookie@2.1.0 type-declarations
> tsc --project tsconfig.build.json --declaration --emitDeclarationOnly --outDir esm && cat esm/index.d.ts | sed 's/^export default /export = /' > cjs/index.d.ts

src/index.ts:284:33 - error TS2345: Argument of type '{ (input: RequestInfo, init?: FetchCookieInit<RequestInit> | undefined): Promise<Response>; toughCookie: typeof import("/Users/leehambley/Library/Caches/Yarn/v6/.tmp/c81626f186160b75360efa5a0bd19eb6.f90f607aeb4918327abc84fc675b337482b2abb6.prepare/node_modules/@types/tough-cookie/index"); }' is not assignable to parameter of type '(input: URL | RequestInfo, init?: RequestInit | undefined) => Promise<Response>'.
  Types of parameters 'input' and 'input' are incompatible.
    Type 'URL | RequestInfo' is not assignable to type 'RequestInfo'.
      Type 'URL' is not assignable to type 'RequestInfo'.

284     return await handleRedirect(fetchCookieWrapper, originalInit, response)
                                    ~~~~~~~~~~~~~~~~~~

Found 1 error in src/index.ts:284

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
{
  "compilerOptions": {
    "esModuleInterop": true
  }
}
valeriangalliat commented 2 years ago

Hey! Can you try installing from npm instead? (yarn add fetch-cookie)

The latest version should be up-to-date with the main branch and because it's prebuilt I believe you shouldn't hit any of those issues with transpiling

leehambley commented 2 years ago

We don't use NPM, we only are using Yarn. Thanks

On Thu, Nov 24, 2022, 4:31 PM Val @.***> wrote:

Hey! Can you try installing from npm instead? (yarn add fetch-cookie)

The latest version should be up-to-date with the main branch and because it's prebuilt I believe you shouldn't hit any of those issues with transpiling

— Reply to this email directly, view it on GitHub https://github.com/valeriangalliat/fetch-cookie/issues/76#issuecomment-1326597703, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEUCBQK7SW5BCVPX7LTTTWJ6C6NANCNFSM6AAAAAASKAFRIQ . You are receiving this because you authored the thread.Message ID: @.***>

leehambley commented 2 years ago

Sorry, sent that ☝️ from my phone without understanding what you were suggesting; I need to install from Git because of my own fork.

piwonskp commented 9 months ago

The issue seem to affect users installing starknet-js via yarn too as it depends on github branch currently. Although error messages are not clear. Installing via npm works fine though.