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

Compile Error #79

Open
LoboMetalurgico opened this issue Feb 14, 2023 · 1 comment
Open

Compile Error #79

LoboMetalurgico opened this issue Feb 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@LoboMetalurgico
Copy link

Describe the bug
When I run npm run build the compiler throw an error.

Using npm@8.19.3 and node@16.19.0

To Reproduce
Clone the repository
Install using PUPPETEER_PRODUCT=chrome npm install
Run npm run build

Expected behavior
Project compile

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • Browser: Chrome
  • Version: Idk

Additional context
Log:

> cloud-proxy@2.1.1 build
> tsc

node_modules/got/dist/source/core/index.d.ts:12:15 - error TS1005: ',' expected.

12 import { type PlainResponse, type Response } from './response.js';
                 ~~~~~~~~~~~~~

node_modules/got/dist/source/core/index.d.ts:12:35 - error TS1005: ',' expected.

12 import { type PlainResponse, type Response } from './response.js';
                                     ~~~~~~~~

node_modules/got/dist/source/core/options.d.ts:21:29 - error TS1005: ',' expected.

21 import http2wrapper, { type ClientHttp2Session } from 'http2-wrapper';
                               ~~~~~~~~~~~~~~~~~~


Found 3 errors.
@LoboMetalurgico LoboMetalurgico added the bug Something isn't working label Feb 14, 2023
@dpapka-giosg
Copy link

dpapka-giosg commented Aug 18, 2023

Hello! Having the same problem. For everybody who is searching the solution.

First, right now package.json contains typescript dependency of version 3.9.7 and one of the project dependencies requires Typescript 4.5+.

This is because import type syntax was introduced in TS 3.8:

import type { SomeThing } from "....";

However, type modifiers on import names were introduced in TS 4.5:

import { someFunc, type BaseType } from ".....";

So the first thing you need to do is updating your Typescript version:

npm install --save-dev typescript@4.5

Then a couple of other errors will appear, like:

node_modules/cacheable-request/dist/types.d.ts:5:72 - error TS2307: Cannot find module 'node:http' or its corresponding type declarations.
5 import { request, RequestOptions, ClientRequest, ServerResponse } from 'node:http';

Update yours @types/node:

npm install --save-dev @types/node@latest

After this you can build the project without errors. @LoboMetalurgico

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants