Build error “Cannot find name 'Record'” with bootstrap 4

后端 未结 6 1997
逝去的感伤
逝去的感伤 2021-02-01 03:31

Today, I decided to migrate my ASP .NET MVC 5 project from bootstrap 3 to bootstrap 4 (the sass version).

After the migration, I got an error after the compilation of my

6条回答
  •  粉色の甜心
    2021-02-01 04:07

    If, for some reason you are unable to update your Visual Studio with the updated TypeScript .exe file (company/business IT policy, non-admin account, etc...), you can try this solution:

    1. Single-click on the "index.d.ts" file in Visual Studio Solution Explorer.
    2. Look in the Properties panel, under "Build Action".
    3. Switch it from "TypeScriptCompile" to "Content".

    Now, you'll be able to build your project without these errors.

    Update 2019 I have found another workaround/solution that hasn't had any noticeable effects and still allows me to compile without erroring on index.d.ts. Just comment line 68 in your index.d.ts file as such:

    //[name: string]: (BaseModifier & Record) | undefined; 
    

提交回复
热议问题