Troubleshooting

This describes common pitfalls to which you can get during compilation or development, and how to solve them. These problems usually produce errors that are not so intuitive, so make sure you read this page.


Top
1.1 Is it safe to stop the compilation script?

Considering client side compilation, NO, it is NOT safe, it can leave the source codes half-replaced. That can be reverted with another script, but better not to do it.

Considering server side compilation, YES, it is safe, as replacement occurs only in build directory.


2.1 TypeError: Class extends value undefined is not a constructor or null

Steps preceeding this error:


Solution

This happens, because you have class A extending B, and in B you import class A by accident.


The diagram xml file can be downloaded here


2.2 Upon compiling, the added code does not propagate to final application (server or client) at all

Steps preceeding this error:

Solution

Delete build folder, and compile all again


This happens, because the compiled classes persist in build, and the dependencies. Moreover, because upon compiling, the compiled files that are no longer needed are not deleted.


Example:


2.3 Upon cleaning and compiling project, weird and insane errors start to emerge

Errors can be following:



Solution

The reason why this can happen if when you backup build directory to the src folder.
For example using:
mv build build_old
Then, the compile script will create new build directory, but tsc will try to compile all sources in build_old directory as well.

Remove the build_old directory or put it out from the src directory.



2.4 Cannot find module '@XXX'

To resolve this, we will use following command to only compile the project, but save the path resolution to a log:

   tsc --traceResolution > dump
There will be alot of output, so use CTRL + F to find the name of the nodule, for which the resolution fails, in this case @ContainerSortTesterSuiteLinkedList'


Here is an excerpt that relates to the module at which our resolution fails.
  ======== Resolving module '@ContainerSortTesterSuiteLinkedList' from '/var/www/html/nodeJsDol/src/test/offline/app/shared/model/other/containers/linkedList/LinkedListMergeSorterTest.ts'. ========
  Module resolution kind is not specified, using 'NodeJs'.
  'baseUrl' option is set to '/var/www/html/nodeJsDol/src', using this value to resolve non-relative module name '@ContainerSortTesterSuiteLinkedList'.
  'paths' option is specified, looking for a pattern to match module name '@ContainerSortTesterSuiteLinkedList'.
  Module name '@ContainerSortTesterSuiteLinkedList', matched pattern '@ContainerSortTesterSuiteLinkedList'.
  Trying substitution '../test/offline/app/shared/model/other/containers/ContainerSortTesterSuiteLinkedList', candidate module location: '../test/offline/app/shared/model/other/containers/ContainerSortTesterSuiteLinkedList'.
  Loading module as file / folder, candidate module location '/var/www/html/nodeJsDol/test/offline/app/shared/model/other/containers/ContainerSortTesterSuiteLinkedList', target file type 'TypeScript'.
  Loading module '@ContainerSortTesterSuiteLinkedList' from 'node_modules' folder, target file type 'TypeScript'.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/shared/model/other/containers/linkedList/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/shared/model/other/containers/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/shared/model/other/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/shared/model/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/shared/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/node_modules' does not exist, skipping all lookups in it.
  File '/var/www/html/nodeJsDol/src/node_modules/@ContainerSortTesterSuiteLinkedList.ts' does not exist.
  File '/var/www/html/nodeJsDol/src/node_modules/@ContainerSortTesterSuiteLinkedList.tsx' does not exist.
  File '/var/www/html/nodeJsDol/src/node_modules/@ContainerSortTesterSuiteLinkedList.d.ts' does not exist.
  File '/var/www/html/nodeJsDol/src/node_modules/@types/@ContainerSortTesterSuiteLinkedList.d.ts' does not exist.
  Directory '/var/www/html/nodeJsDol/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/node_modules' does not exist, skipping all lookups in it.
  Directory '/node_modules' does not exist, skipping all lookups in it.
  'baseUrl' option is set to '/var/www/html/nodeJsDol/src', using this value to resolve non-relative module name '@ContainerSortTesterSuiteLinkedList'.
  'paths' option is specified, looking for a pattern to match module name '@ContainerSortTesterSuiteLinkedList'.
  Module name '@ContainerSortTesterSuiteLinkedList', matched pattern '@ContainerSortTesterSuiteLinkedList'.
  Trying substitution '../test/offline/app/shared/model/other/containers/ContainerSortTesterSuiteLinkedList', candidate module location: '../test/offline/app/shared/model/other/containers/ContainerSortTesterSuiteLinkedList'.
  Loading module as file / folder, candidate module location '/var/www/html/nodeJsDol/test/offline/app/shared/model/other/containers/ContainerSortTesterSuiteLinkedList', target file type 'JavaScript'.
  Loading module '@ContainerSortTesterSuiteLinkedList' from 'node_modules' folder, target file type 'JavaScript'.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/shared/model/other/containers/linkedList/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/shared/model/other/containers/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/shared/model/other/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/shared/model/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/shared/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/app/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/offline/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/nodeJsDol/src/test/node_modules' does not exist, skipping all lookups in it.
  File '/var/www/html/nodeJsDol/src/node_modules/@ContainerSortTesterSuiteLinkedList.js' does not exist.
  File '/var/www/html/nodeJsDol/src/node_modules/@ContainerSortTesterSuiteLinkedList.jsx' does not exist.
  Directory '/var/www/html/nodeJsDol/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/html/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/www/node_modules' does not exist, skipping all lookups in it.
  Directory '/var/node_modules' does not exist, skipping all lookups in it.
  Directory '/node_modules' does not exist, skipping all lookups in it.
  ======== Module name '@ContainerSortTesterSuiteLinkedList' was not resolved. ========

Solution

Read the log, and find a such a path to be put to tsconfig.json, so that the wile would be found