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.

export typescript keyword isn't ignored on transpiling

See original GitHub issue

Expected Behavior

export const pi = 3.141592; in a typescript file to become: const pi = 3.141592; in gas.

Actual Behavior

My app script has this instead:

exports.__esModule = true;
exports.pi = 3.141;

Which raises the following error:

ReferenceError: "exports" is not defined. (line 1, file "src/foo")

Steps to Reproduce the Problem

  1. make a typescript file with example from docs
  2. clasp push
  3. inspect code in app scripts

Specifications

  • Node version (node -v): 10.7.0
  • Version (clasp -v): 1.5.0
  • OS (Mac/Linux/Windows): Mac

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
nick-brainlabscommented, Aug 1, 2018

@grant 1.5.2 fixes it and jest is running fine. This is really exciting, thanks for looking into it!

0reactions
grantcommented, Aug 1, 2018

@nick-brainlabs Can you see if 1.5.2 has the error Error: Debug Failure. Unexpected moduleResolution: false?

Can you paste the error again with the source code to reproduce it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interface argument of TypeScript is not working when the code ...
The error is just saying that it can't read the property opt.headers because opt is undefined . You should actually be getting a...
Read more >
Documentation - Modules - TypeScript
Exporting a declaration ... Any declaration (such as a variable, function, class, type alias, or interface) can be exported by adding the export...
Read more >
Configuring TypeScript compiler - inDepthDev
This article explores in depth essential TypeScript configuration options. We'll learn how to configure input and output files location, file types, transpiling ......
Read more >
next-transpile-modules - npm
Next.js plugin to transpile code from node_modules. ... TypeScript icon, indicating that this package has built-in type declarations.
Read more >
type-only imports — A new TypeScript feature that benefits ...
Example 1 — Ambiguous re-export · Babel removes everything from our types module because it only contained types, which have no use in...
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