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

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

Closed
valen22br opened this issue Aug 23, 2018 · 6 comments
Closed

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

valen22br opened this issue Aug 23, 2018 · 6 comments

Comments

@valen22br
Copy link
Contributor

(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/[email protected] build: tsc --project tsconfig.json && npm i -g --l oglevel=error
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @google/[email protected] 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
@grant
Copy link
Contributor

grant commented Aug 23, 2018

It's an error. Can you submit a PR to fix it?
Otherwise I'll do it quickly.

@valen22br
Copy link
Contributor Author

I'm getting error 403 when I try to push my branch. Do you know how to solve that?

@grant
Copy link
Contributor

grant commented Aug 23, 2018

Can you press the fork button on the top right, clone that repo, then push to that repo?
After you push, you'll see there is a button to submit a Pull Request.
https://help.github.com/articles/creating-a-pull-request/
https://help.github.com/articles/creating-a-pull-request-from-a-fork/

@valen22br
Copy link
Contributor Author

I just submitted the PR.
Thanks!

@grant
Copy link
Contributor

grant commented Aug 23, 2018

Fixed with #298.

@grant grant closed this as completed Aug 23, 2018
@grant
Copy link
Contributor

grant commented 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/[email protected] build: tsc --project tsconfig.json && npm i -g --l oglevel=error
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @google/[email protected] 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!

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

2 participants