Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, December 5, 2017 9:42:51 AM(UTC)
Toadfish

Groups: Registered
Posts: 20


I have an Angular2 application that uses Leadtools. It uses Angular-CLI and webpack to build.

When I attempt to even place the Leadtools.Documents.d.ts in my application folder structure, I get the following error:
Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at createSourceFile (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:16640:109)
at parseSourceFileWorker (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:16572:26)
at Object.parseSourceFile (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:16521:26)
at Object.createSourceFile (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:16371:29)
at WebpackCompilerHost.getSourceFile (D:\Apps\PCV2\node_modules\@ngtools\webpack\src\compiler_host.js:239:27)
at findSourceFile (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:70246:29)
at args (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:70200:85)
at getSourceFileFromReferenceWorker (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:70173:34)
at processSourceFile (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:70200:13)
at D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:70287:17
at Object.forEach (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:1506:30)
at processReferencedFiles (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:70285:16)
at findSourceFile (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:70270:21)
at processImportedModules (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:70393:25)
at findSourceFile (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:70274:17)
at processImportedModules (D:\Apps\PCV2\node_modules\typescript\lib\typescript.js:70393:25)

Removing this file removes the error.

Any help would be appreciated.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, December 7, 2017 2:48:51 PM(UTC)
Anthony Northrup

Groups: Registered, Tech Support, Administrators
Posts: 199

Was thanked: 28 time(s) in 28 post(s)

Hello Kevin,

Apologies for the long delay before getting a response from us. There is an issue on the angular-cli github that appears to be exactly what you're experiencing: https://github.com/angular/angular-cli/issues/5053.
Looking through that, it could a number of things, here are two to check for starters:

  • Ensure any file referenced in the .d.ts files via ///<reference path="./foo.d.ts" /> exists
  • Check if you have a file environment.prod.ts, below is an example from one of the users on the issue linked above

Code:

export const environment = {
  production: true,
  silent: false
};
Anthony Northrup
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Friday, December 8, 2017 9:26:14 AM(UTC)
Toadfish

Groups: Registered
Posts: 20


Thank you. The references in Leadtools.Documents.d.ts was the problem.
I changed:
/// <reference path="jquery/jquery.d.ts" />

To point to the jquery index file in my node-modules:
/// <reference path="../../../../../node_modules/@types/jquery/index.d.ts" />

This solved my issues.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.059 seconds.