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.

error "ReferenceError: xx is not defined" when extends class

See original GitHub issue

child class extends parent, must have filename larger than parent class

otherwise error in title will happen

issue reference

https://issuetracker.google.com/issues/192152736

more description

filename: AAAA.ts

(any parent class)

filename: AAAA1.ts

(any extends the parent class)

ie:

  • (child filename) AAAA1.ts > (parent filename) AAAA.ts, it works
  • child filename< parent filname, it failed

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ryancwalshcommented, Jul 8, 2022

This problem is kicking my butt. If I had known ahead of time that .gs files don’t really support TypeScript, I wouldn’t have spent so many hours converting them just now.

I’ve unsuccessfully tried the workarounds at https://github.com/google/clasp/blob/e851215b8abe4de282c62c4d61076c85e89a56ba/docs/typescript.md#typescript-support and https://github.com/google/clasp/issues/796#issuecomment-663966924 and am not sure what else to try at this point.

If I figure something out, I’ll post here.

0reactions
peterweb2005commented, Dec 10, 2022

my workaround: parent class should have lower alphabet order, eg: AppService extends 1AppServiceBase

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError: "x" is not defined - JavaScript - MDN Web Docs
ReferenceError : "x" is not defined. The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
Read more >
"ReferenceError: this is not defined" in subclass - Stack Overflow
You need to call the super constructor: class Person extends Node { constructor() { super(); } }. For reference, I actually tested your...
Read more >
"this" is not defined in constructor method of child class #1723
In a child class (that extends from a parent), if you try to access this before super() is called, iojs will throw an...
Read more >
Errors | Node.js v19.3.0 Documentation
Class : ReferenceError #. Extends: <errors.Error>. Indicates that an attempt is being made to access a variable that is not defined. Such errors...
Read more >
ReferenceError: "x" is not defined - JavaScript
The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
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