Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post-install script prevents installation #76

Open
leehambley opened this issue Nov 24, 2022 · 4 comments
Open

Post-install script prevents installation #76

leehambley opened this issue Nov 24, 2022 · 4 comments

Comments

@leehambley
Copy link

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
Copy link
Owner

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
Copy link
Author

leehambley commented Nov 24, 2022 via email

@leehambley
Copy link
Author

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

@piwonskp
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants