Skip to content

Invalid export in /googleapis/build/src/index.d.ts #2357

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

Closed
salitha-pathi opened this issue Sep 9, 2020 · 8 comments · Fixed by #2362
Closed

Invalid export in /googleapis/build/src/index.d.ts #2357

salitha-pathi opened this issue Sep 9, 2020 · 8 comments · Fixed by #2362
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@salitha-pathi
Copy link

salitha-pathi commented Sep 9, 2020

Following error raises when the library is used with Loopback 4

`node_modules/googleapis/build/src/index.d.ts:5:10 - error TS1005: 'from' expected.

5 export * as Common from 'googleapis-common';
~~

node_modules/googleapis/build/src/index.d.ts:5:13 - error TS1005: ';' expected.

5 export * as Common from 'googleapis-common';
~~~~~~

node_modules/googleapis/build/src/index.d.ts:5:20 - error TS1005: ';' expected.

5 export * as Common from 'googleapis-common';
~~~~

node_modules/googleapis/build/src/index.d.ts:5:25 - error TS1005: ';' expected.

5 export * as Common from 'googleapis-common';
`

Environment details

1.
  • OS: Windows 10 x64
  • Node.js version: 12.13.1
  • npm version: 6.12.1
  • googleapis version: 59.0.0
  • typescript version: 3.7.5
2.
  • OS: Ubuntu 18.04 LTS
  • Node.js version: 12.10.0
  • npm version: 6.14.4
  • googleapis version: 59.0.0
  • typescript version: 3.7.5

Thanks!

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Sep 10, 2020
@ocket8888
Copy link

ocket8888 commented Sep 12, 2020

I get the same problem - not using loopback, though, just a typescript server being webpack-ed by angular 8 for server-side-rendering.

Edit: actually I noticed that my problem is merely similar. I get these problems trying to import Auth:

ERROR in /home/ocket8888/src/myapp/server.ts
./server.ts
[tsl] ERROR in /home/ocket8888/src/myapp/server.ts(30,18)
      TS2305: Module '"./node_modules/googleapis/build/src"' has no exported member 'Auth'.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(5,10)
      TS1005: 'from' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(5,13)
      TS1005: ';' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(5,20)
      TS1005: ';' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(5,25)
      TS1005: ';' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(6,10)
      TS1005: 'from' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(6,13)
      TS1005: ';' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(6,18)
      TS1005: ';' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(6,23)
      TS1005: ';' expected.

I'm not actually sure if it's the same problem, but they look related at a glance

@salitha-pathi
Copy link
Author

I get the same problem - not using loopback, though, just a typescript server being webpack-ed by angular 8 for server-side-rendering.

Edit: actually I noticed that my problem is merely similar. I get these problems trying to import Auth:

ERROR in /home/ocket8888/src/myapp/server.ts
./server.ts
[tsl] ERROR in /home/ocket8888/src/myapp/server.ts(30,18)
      TS2305: Module '"./node_modules/googleapis/build/src"' has no exported member 'Auth'.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(5,10)
      TS1005: 'from' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(5,13)
      TS1005: ';' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(5,20)
      TS1005: ';' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(5,25)
      TS1005: ';' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(6,10)
      TS1005: 'from' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(6,13)
      TS1005: ';' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(6,18)
      TS1005: ';' expected.

ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts
[tsl] ERROR in /home/ocket8888/src/myapp/node_modules/googleapis/build/src/index.d.ts(6,23)
      TS1005: ';' expected.

I'm not actually sure if it's the same problem, but they look related at a glance

Yes, this is same issue

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Sep 14, 2020
@JustinBeckwith JustinBeckwith added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Sep 14, 2020
@yoshi-automation yoshi-automation removed triage me I really want to be triaged. 🚨 This issue needs some love. labels Sep 14, 2020
@bcoe
Copy link
Contributor

bcoe commented Sep 17, 2020

@HachimanHiki @salitha-pathi if you run [email protected], do you run into this issue? This seems like it might be a regression in TypeScript itself, as we're not seeing it in our own compilation.

@ocket8888
Copy link

I'm using an Angular 8 project which doesn't work with Typescript > 3.6. Is there an older version of googleapis that would support Angular 8?

@bcoe
Copy link
Contributor

bcoe commented Sep 17, 2020

@ocket8888 yes, please try installing npm i googleapis@legacy-8.

@HachimanHiki
Copy link
Contributor

HachimanHiki commented Sep 18, 2020

It works for me with [email protected]. My original version is [email protected].

@HachimanHiki
Copy link
Contributor

HachimanHiki commented Sep 18, 2020

microsoft/TypeScript#34903 adds support for the new export * as ns from 'specifier' syntax, which is after [email protected].

@JustinBeckwith
Copy link
Contributor

Looks like this one is solved - to use this lib, you need to be using at least TypeScript 3.8.x. Sadly - there's no way we can figure out how to express which version of TypeScript we require in a programmatic sense (peer dependencies, optional dependencies, strict engine checks, etc).

I know this answer isn't super fulfilling, but our plan is to start gating TypeScript tooling version on semver major releases of the library (which for this library ... is often.).

@JustinBeckwith JustinBeckwith self-assigned this Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants