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. Image for the cookie policy date

creating new project with template doesnt work

I have just installed latest version EJ2 and created a new syncfusion web mvc project. then without doing any single change, i tried to run the test project. i get this error. What is the problem here? can you please suggest?

Severity Code Description Project File Line Suppression State
Error Build:Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.  Scripts\ej2\ej2.d.ts 71584


9 Replies

JD Jayakumar Duraisamy Syncfusion Team January 18, 2019 10:35 AM UTC

Hi Emil, 
We have analyzed the reported issue and it is general problem occurs when create a new project manually using like Visual studio tool. Hence, we need to add the TypeScript Libraries tag in your ‘csproj’ file to overcome this issue.  
Please refer the below code snippet,  
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
   <TypeScriptRemoveComments>False</TypeScriptRemoveComments>
   <TypeScriptLib>dom,es2015</TypeScriptLib>
    <TypeScriptOutFile />     
</PropertyGroup> 
In our Syncfusion sample creator, we will include this solution by default while creating the demo samples. For that, we have created improvement task and you can also track the status of following task through our feedback portal,  
This support will be available in our upcoming volume 4, 2018 service pack 1 release which is expected to be roll out in the first week of February 2019. Also, we will publish the knowledge base documentation on January 21, 2019. 
Please let us know, if you need any other assistance. 
Regards,  
Jayakumar D  



MV Malcolm van Staden February 18, 2020 01:16 PM UTC

Hi,

I'm not sure if this a sufficient solution but it worked for us, so I'm adding it here for anyone else that ends up having the same problem.

Under the folder that contains the ej2.d.ts (Scripts/ej2) add the following file:

tsconfig.json

Contents of this file:

{
  "compilerOptions": {
    "target": "ES2015",
    "module": "commonjs",
    "sourceMap": true
  }
}


VR Vairamuthu Ramamoorthi Syncfusion Team February 25, 2020 07:08 AM UTC

Hi Malcolm, 

Thanks for your suggestion. 

As discussed earlier, the main cause of this problem occurs due to not including the required target library for the TypeScript compiler option. We can overcome this problem by using any of the following solutions.  

#1 using tsconfig.json, by adding required lib to ‘target’ from compilerOptions. 


  "compilerOptions": { 
    //... 
    "target": "ES2015" 
  }, 
  //... 

 
 
#2 Using MS build 

As we suggested in our last update, we can resolve this by adding the required library to the TypeScript Libraries tag in your ‘csproj’ file. Please refer to the below link.  

KB Link: 


Note: 
If ‘tsconfig.json’ exists in your project, then it will use the compiler setting from this configuration file. Otherwise, it will use the specified compiler setting from the project file (.csproj) fiile. 

 

Please feel free to get back to us if you have any queries. 

Regards, 
Vairamuthu R 



RA Ravi June 11, 2020 04:55 AM UTC

Great this is works.. project was not building says compile time error after this its works


JA Jesus Arockia Sankaran S Syncfusion Team June 12, 2020 05:15 AM UTC

Hi Ravi, 

We are glad that the provided information solved your problem. 

Regards, 
Jesus Arockia Sankaran S 



FF Felix Fosu replied to Malcolm van Staden June 2, 2022 10:57 AM UTC

Thank you,

This worked for me too.



JL Joshna Lingala Uthama Reddy Lingala Syncfusion Team June 3, 2022 10:22 AM UTC

Hi Felix,


You are Welcome...!


Please get back to us if you need further assistance.


Regards,

Joshna L



MV Mark Visschers February 24, 2023 08:08 AM UTC

I noticed that visual studio these days warns that you are including a package that is dependent on Typescript and suggests to add the `Microsoft.TypeScript.MSBuild` package. However that does not solve the issue.

typescript_dependency.png


The above suggested actions do solve this though.



BH BharatRam Harikrishnan Syncfusion Team March 1, 2023 12:51 PM UTC

Hi Mark,

 

Yes as we suggested, you can resolve the issue by adding the required target library either using MS build or using tsconfig.json. Please refer to the below UG link.

https://ej2.syncfusion.com/aspnetmvc/documentation/common/how-to/troubleshoot

 

References:

https://learn.microsoft.com/en-us/visualstudio/javascript/compile-typescript-code-nuget?view=vs-2022

https://www.typescriptlang.org/docs/handbook/compiler-options-in-msbuild.html

 

Please get back to us with more details if we misunderstood your query.

 

Regards,

Bharat Ram H


Loader.
Live Chat Icon For mobile
Up arrow icon