0

I am getting error while creating the build for my app. But even trying multiple solutions like skiplibcheck, @ts-ignore, @ts-nocheck, upgrading and downgrading the version of react-leaflet library that I have used. I am not getting any issues with the current version while running my code in local machine No type issue no any other issues just getting the type issues in node_modules of @types/leaflet.

copyfiles -a ../../node_modules/@pdftron/webviewer/public/. ./public/lib
../../node_modules/@types/leaflet/index.d.ts:2504:51 - error TS1144: '{' or ';' expected.

2504     ): { new(...args: any[]): T } & typeof Control<Options>;
                                                       ~
../../node_modules/@types/leaflet/index.d.ts:2504:60 - error TS1109: Expression expected.

2504     ): { new(...args: any[]): T } & typeof Control<Options>;
                                                                ~
../../node_modules/@types/leaflet/index.d.ts:2505:25 - error TS1109: Expression expected.

2505     constructor(options?: Options);
                             ~
../../node_modules/@types/leaflet/index.d.ts:2506:18 - error TS1005: ';' expected.

2506     getPosition(): ControlPosition;
                      ~
../../node_modules/@types/leaflet/index.d.ts:2507:25 - error TS1005: ',' expected.

2507     setPosition(position: ControlPosition): this;
                             ~
../../node_modules/@types/leaflet/index.d.ts:2507:43 - error TS1005: ';' expected.

2507     setPosition(position: ControlPosition): this;
                                               ~
../../node_modules/@types/leaflet/index.d.ts:2508:19 - error TS1005: ';' expected.

2508     getContainer(): HTMLElement | undefined;
                       ~
../../node_modules/@types/leaflet/index.d.ts:2509:14 - error TS1005: ',' expected.

2509     addTo(map: Map): this;
                  ~
../../node_modules/@types/leaflet/index.d.ts:2509:20 - error TS1005: ';' expected.

2509     addTo(map: Map): this;
                        ~
../../node_modules/@types/leaflet/index.d.ts:2510:13 - error TS1005: ';' expected.

2510     remove(): this;
                 ~
../../node_modules/@types/leaflet/index.d.ts:2513:34 - error TS1005: '=>' expected.

2513     onAdd?(map: Map): HTMLElement;
                                    ~
../../node_modules/@types/leaflet/index.d.ts:2514:30 - error TS1005: '=>' expected.

2514     onRemove?(map: Map): void;
                                  ~
../../node_modules/@types/leaflet/index.d.ts:2517:1 - error TS1128: Declaration or statement expected.

2517 }
     ~

Found 13 errors.

npm error Lifecycle script `compile` failed with error:
npm error code 1
npm error path E:\Flixoo Workspace\WebClient\src\packages\web
npm error workspace [email protected]
npm error location E:\Flixoo Workspace\WebClient\src\packages\web
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c yarn configDeps && tsc -b
error Command failed with exit code 1.
  • My react and typescript version is
"react": "16.11.0",
"typescript": "4.1.3"
  • I am using a react-leaflet, leaflet and @types/leaflet
"react-leaflet": "~3.1.0",
"leaflet": "~1.7.1",
"@types/leaflet": "1.5.24"
  • My package.json file script for web is

  "scripts": {
    "configDeps": "copyfiles -a ../../node_modules/@pdftron/webviewer/public/. ./public/lib",
    "compile": "yarn configDeps && tsc -b",
    "prestart": "npm run compile",
    "start": "concurrently \"npm run compile -- -w --incremental\" \"HTTPS=true npm run _start\"",
    "windows_start": "concurrently \"npm run compile -- -w --incremental\" \"npm run _start\"",
    "_start": "set NODE_OPTIONS=--openssl-legacy-provider && react-app-rewired start",
    "prebuild": "npm run compile",
    "build": "set NODE_OPTIONS=--openssl-legacy-provider && react-app-rewired build",
    "pretest": "npm run compile",
    "test": "react-app-rewired test",
    "eject": "react-app-rewired eject",
    "lint": "eslint 'src/*.{js,ts,tsx}' --fix"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ],

I tried multiple solution like skiplibcheck, @ts-ignore, @ts-nocheck, upgrading and downgrading the version of react-leaflet, leaflet, @types/leaflet library but getting nowhere

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.