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

'undefined' inside complied comment #957

Open
fullth opened this issue Feb 3, 2023 · 4 comments
Open

'undefined' inside complied comment #957

fullth opened this issue Feb 3, 2023 · 4 comments

Comments

@fullth
Copy link

fullth commented Feb 3, 2023

(Note: Non-breaking issues are likely not to be prioritized. Please consider a PR in addition to your issue)

Expected Behavior

Replace something instead 'undefined'.

Actual Behavior

Commented at the top '// Compiled using undefined undefined (TypeScript 4.9.5)'

Steps to Reproduce the Problem

  1. I replaced file type 'Code.js' with 'Code.ts'
  2. clasp push

Specifications

  • Node version (node -v): v14.20.0
  • Version (clasp -v): v2.4.2
  • OS (Mac/Linux/Windows): Windows
@InExSu
Copy link

InExSu commented Dec 29, 2023

yes, in *.gs files see

// Compiled using undefined undefined (TypeScript 4.9.5)

tsconfig.json
{ "compilerOptions": { "lib": [ "esnext" ], "experimentalDecorators": true } }

node -v v21.2.0
clasp -v 2.4.2
OS: Mac Ventura

@pmaczko
Copy link

pmaczko commented Apr 9, 2024

Any progress? I started using clasp few days ago and after tutorial I see the same comment with undefined... Thanks in advance for any help!

UPDATE:
Small progress :) The second undefined is related to version in package.json!
My current comment: // Compiled using undefined 0.0.1 (TypeScript 4.9.5), so I suppose the first undefined will be related to other value from project settings.

@PopGoesTheWza
Copy link
Collaborator

The comment originates from this line in ts2gas

https://github.com/grant/ts2gas/blob/535c850b0fd92203f885a8623f65caaa70887c51/src/index.ts#L374

I am unsure if either ts2gas or clasp need to be updated. I have stopped using Google Sheets and clasp a few years ago and no longer contribute these projects.

@ivancho1707
Copy link

So the undefined parts come from the package.json fields name and version, declaring them properly will return a "good" output

{
  "name": "my-project",
  "version": "1.0.0",
  "devDependencies": {
    "@types/google-apps-script": "^1.0.83"
  }
}

compiled file example output:

// Compiled using my-project 1.0.0 (TypeScript 4.9.5)
...

This might well be fixed documenting this behavior or prompting user for these values when creating or importing a project

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

5 participants