question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to build Clasp. Duplicated Lines of Code in file auth.ts

See original GitHub issue

(Please search existing issues before creating a new one.)

Expected Behavior

Have clasp build after run the command npm run build

Actual Behavior

error during the building process:

tsc --project tsconfig.json && npm i -g --loglevel=error

src/auth.ts:1:13 - error TS2300: Duplicate identifier ‘fs’.

1 import * as fs from ‘fs’; ~~

src/auth.ts:2:13 - error TS2300: Duplicate identifier ‘fs’.

2 import * as fs from ‘fs’; ~~

src/auth.ts:11:10 - error TS2300: Duplicate identifier ‘Discovery’.

11 import { Discovery } from ‘googleapis/build/src/apis/discovery/v1’; ~~~~~~~~~

src/auth.ts:12:10 - error TS2300: Duplicate identifier ‘Discovery’.

12 import { Discovery } from ‘googleapis/build/src/apis/discovery/v1’; ~~~~~~~~~

npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! @google/clasp@1.5.3 build: tsc --project tsconfig.json && npm i -g --l oglevel=error npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the @google/clasp@1.5.3 build script. npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\GL000017\AppData\Roaming\npm-cache_logs\2018-08-23T18_48_ 39_488Z-debug.log

Steps to Reproduce the Problem

  1. Clone the project
  2. Run the steps under “Develop” section
  3. See the error

Specifications

  • Node version (node -v): v8.11.4
  • Version (clasp -v): 1.5.3
  • OS (Mac/Linux/Windows): Windows 7

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
valen22brcommented, Aug 23, 2018

I just submitted the PR. Thanks!

0reactions
grantcommented, Aug 24, 2018

I’m going to delete the comments in the other thread since they are off topic. Here they are:

Hi @grant , I was recreating my development environment and now I can’t build clasp anymore using the command npm run build or npm run build-fresh.

Following is the error:

tsc --project tsconfig.json && npm i -g --loglevel=error

src/auth.ts:1:13 - error TS2300: Duplicate identifier ‘fs’.

1 import * as fs from ‘fs’; ~~

src/auth.ts:2:13 - error TS2300: Duplicate identifier ‘fs’.

2 import * as fs from ‘fs’; ~~

src/auth.ts:11:10 - error TS2300: Duplicate identifier ‘Discovery’.

11 import { Discovery } from ‘googleapis/build/src/apis/discovery/v1’;


src/auth.ts:12:10 - error TS2300: Duplicate identifier 'Discovery'.

12 import { Discovery } from 'googleapis/build/src/apis/discovery/v1';

npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! @google/clasp@1.5.3 build: tsc --project tsconfig.json && npm i -g --l oglevel=error npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the @google/clasp@1.5.3 build script. npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\GL000017\AppData\Roaming\npm-cache_logs\2018-08-23T18_37_ 47_980Z-debug.log

@valen22br Contributor valen22br (Luis Gustavo Grubert Valensuela) 9 hours ago I’m looking at your code, specifically at auth.ts file, and there are some duplicated lines on it. I removed the duplicated lines, and it is building successfully. Why were those lines duplicated?

@grant Member grant 9 hours ago @valen22br Ah, that looks like a separate issue (from a separate change). Can we discuss this in a separate GitHub Issue?

@valen22br Contributor valen22br (Luis Gustavo Grubert Valensuela) 9 hours ago Yes, no problem!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Confusing "duplicate identifier" Typescript error message
I am adding a link to the repo as well as key code snippets below. I think I have a basic misunderstanding of...
Read more >
Import considered as duplicated lines in SonarQube
Hi, A PR failing at SonarQube check due to duplicated lines in new code. The thing is the duplicated code is just module...
Read more >
Chapter 4. Working with duplicate code - SonarQube in Action
When you start a new project, you have a clean code base with no duplications, unless you copied another project to start with....
Read more >
how to ignore duplicate code in sonarqube - You.com
I'm trying to analyse a huge java project (over 1 million lines of code) with ... auth required pamenv.so auth required pamtally2.so deny=5...
Read more >
Solution Explorer showing duplicate files
Project file looks fine to me. Will see if I can repro it locally creating an AzureFunctions project from the command line. Which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found