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.

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

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JustinBeckwithcommented, Nov 14, 2020

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.).

0reactions
HachimanHikicommented, Sep 18, 2020

microsoft/TypeScript#34903 adds support for the new export * as ns from ‘specifier’ syntax, which is after typescript@3.8.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript typings give me "index.d.ts is not a module"
In TypeScript, just as in ECMAScript 2015, any file containing a top-level import or export is considered a module. Conversely, a file without...
Read more >
Documentation - Modules .d.ts - TypeScript
One style of exporting in CommonJS is to export a function. Because a function is also an object, then extra fields can be...
Read more >
rollup-plugin-dts - npm
Exporting namespaces currently does not work and will create invalid .d.ts files. import * as ...
Read more >
ae-forgotten-export - API Extractor
This message is reported when an exported API refers to another declaration that is not exported ... needs to be exported by the...
Read more >
TypeScript errors and how to fix them
If you want to export a constant from a definition file ( d.ts ), then you have to use the export ... export...
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