We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Angular-CLI Cannot find name 'ej'

Thread ID:

Created:

Updated:

Platform:

Replies:

130112 Apr 22,2017 06:08 PM UTC Jan 24,2018 02:41 PM UTC Angular 12
loading
Tags: General
mujef
Asked On April 22, 2017 06:08 PM UTC

I have created new application using angular CLI as Abinaya Subbiah described here: https://www.syncfusion.com/forums/127630/how-to-work-with-angular-cli
I have typings installed in my package.json:
"devDependencies: {
...
"@types/ej.web.all": "^15.1.4" //I have tried version "^0.0.1" - didn't help
}

I try to use "ej" namespace to configure my ej-grid (ej.Grid.SummaryType.Sum)

When I try to start my application it throws an error "Cannot find name 'ej'".

How should I install typings for my Angular CLI appliacion?

Mani Sankar Durai [Syncfusion]
Replied On April 24, 2017 12:35 PM UTC

 
Hi mujef, 
 
                                                               
Thanks for contacting Syncfusion support. 
 
 
We suspect that the issue occurred due to typings not installed properly in the sample. In some system environment typings will not be installed properly, so please ensure typings are installed properly in the application as like the below screenshot.  
   
       
  
  • To install Syncfusion JavaScript and Angular 2 components run below commands from sample’s root folder. 
   
npm install --save-dev @types/ej.web.all   
   
    
·         Now the typings will be installed properly.    
 
If you still face the issue please get back to us with the following details. 
1.       Share the screenshot/video of the issue that you have faced 
2.       If possible share the sample with issue reproducing. 
 
The provided information will help us to analyze the issue and provide you the response as early as possible. 
  
Please let us know if you need further assistance 

Regards, 
Manisankar Durai. 


mujef
Replied On April 24, 2017 12:44 PM UTC

I have ej.web.all typings in node_modules folder - exactly like on your screenshot.
npm install command didn't help.
When I try to start my appliaction angular cli shows "Cannot find name 'ej'" in file where I use it.
The same error is displayed in the browser when I open my application address.

mujef
Replied On April 24, 2017 02:24 PM UTC

To reproduce the issue:
1) create new app as described On March 8, 2017 01:37 AM in https://www.syncfusion.com/forums/127630/how-to-work-with-angular-cli
2) in app.component.ts create
test () {
   const a = ej.DataManager;
}
3) run ng serve --aot false

Mani Sankar Durai [Syncfusion]
Replied On April 25, 2017 01:29 PM UTC

Hi mujef, 

We have analyzed your query and we are able to reproduce the reported issue. We suspect that the ej.web.all in types will be referred before the jquery rendered in tsconfig.app. So this issue occurs. To avoid this we suggest you to change the ej.web.all after the jquery renders in your tsconfig.app file. 
Note: tsconfig.app JSON file will be located in src folder of your project file. 

Refer the code example. 
[tsconfig.app] 
 
{ 
  "compilerOptions": { 
    "sourceMap": true, 
    "declaration": false, 
    "moduleResolution": "node", 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "lib": [ 
      "es2016", 
      "dom" 
    ], 
    "outDir": "../out-tsc/app", 
    "target": "es5", 
    "module": "es2015", 
    "baseUrl": "", 
    "typeRoots": [ 
      "node_modules/@types/" 
    ], 
    "types": [ 
      "jquery", 
      "ej.web.all", 
      "node", 
      "es6-shim" 
    ] 
  }, 
  "exclude": [ 
    "test.ts", 
    "**/*.spec.ts" 
  ] 
} 
 


We have also prepared a sample that can be downloaded from the below link 

If you still face the issue please share us the following details. 
1.       Share the code example. 
2.       Share the screenshot of the issue with stack trace 
3.       If possible share the sample with issue reproducing. 
The provided information will help us to analyze the requirement and provide you the response as early as possible. 

Please let us know if you need further assistance. 

Regards, 
Manisankar Durai. 


Flavio
Replied On October 27, 2017 12:50 PM UTC

I have the same problem here, Im just trying the Schedule component.

I have installed and configured everything, that is working fine, but when I use "ej." it throw an error.



Mani Sankar Durai [Syncfusion]
Replied On October 30, 2017 12:51 PM UTC

Hi Flavio, 


A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.   
 
 
 
Regards,   
Manisankar Durai 
 


Christopher Römer
Replied On November 14, 2017 09:38 AM UTC

Hi Mani Sankar Durai,


any updates on this topic?

Experiencing the same problem, source code is working, but ej. throws an error and no code-completion/suggestion is working, which is unfortune!


Glad to hear from you,

regards Christopher


Mani Sankar Durai [Syncfusion]
Replied On November 15, 2017 10:25 AM UTC

Hi Christopher, 


  • Run the below command to install typing file ej.web.all
    
npm install @types/ej.web.all --save-dev  
    
     
·       Now the typings will be installed properly.  
 
Kindly try the sample and if the issue persists, try to reproduce the error in a sample and revert it back to us. Or else you can share your code example (ts and html file)/runnable sample (if possible) to proceed further.    

Regards, 
Manisankar Durai. 


Christopher Römer
Replied On November 15, 2017 01:01 PM UTC

Hi Manisankar,

the problem still persists. 
I took your example, did the steps you wrote and just wanted to implement a ej.DataManager with connection to a OData-Service.

Regards Christopher

Attachment: angularcli_still_not_found_1a9da08a.zip

Mani Sankar Durai [Syncfusion]
Replied On November 16, 2017 02:49 PM UTC

Hi Christopher,   
  
You have missed to include new keyword in front of the DataManager, hence the error. Kindly refer to the following code snippet.   
  
[app.component.ts]   
this.dataManger = new ej.DataManager({    
    url: "http://localhost:2088/api"// web api url    
    crossDomain: true,     
    adaptor: new ej.WebApiAdaptor()  });    
   
Regards,   
Manisankar Durai. 
 


Ruben
Replied On January 23, 2018 12:21 PM UTC

Hi! I am also encountering the same problem: "error TS2304: Cannot find name 'ej'".
I am using Rider IDE on Linux. I can run the Angular app, the IDE recognizes the ej(when i click on "go to source code"), but when it comes to testing the angular app, Karma yields that it does not recognize it. 

I have to mention that when I try to run the command ''npm install --save-dev @types/ej.web.all", I get these 'errors':
...-client@1.0.0 /home/ruben-grab/Work/.../.../src/....../Client/... // just the path to my Angular application.
├── UNMET PEER DEPENDENCY @angular/animations@5.1.3
├── UNMET PEER DEPENDENCY @angular/compiler@5.2.1
├── UNMET PEER DEPENDENCY @angular/core@5.2.1
├── @types/ej.web.all@15.4.2 
└── UNMET PEER DEPENDENCY tslint@5.8.0

The thing is, I have installed all those modules, but just a slightly lower version
Could you point me in the right direction? I am not using Karma right? I do not installed the typings the right way? 
 Thank you for your time!


Subha Shree Ramanathan [Syncfusion]
Replied On January 24, 2018 02:41 PM UTC

Hi Ruben, 

The issue “Cannot find name ‘ej’” is occurred due to our typings @types/ej.web.all is not installed properly. So we suggest you to install the typings NPM package @types/ej.web.all properly. 

Query: I try to run the command ''npm install --save-dev @types/ej.web.all", I get these 'errors': 
 
We have tried out a sample with the given versions of Angular packages which does not throws any error. Refer to the below screenshot for installation of our typings. 
 
 

For your convenience we have prepared a sample with Karma configuration and attached below.  


We documented the steps to integrate our Angular components in Karma and Jasmine and attached below. 


If you are still facing any issues, please share the below information with us. 

  • IDE specification (version)
  • Node and NPM Version
  • Modify the attached sample to reproduce the issue

Please let us know if you need further assistance on this. 

Thanks, 
Subha Shree D.R 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;