Typescript compile error from Libman library in ReactJS.NET project

  Uncategorised

I’m picking up a project from a few years ago that was written with a Visual Studio Template that uses ReactJS.NET. It’s hosted on an IIS server with .NET Core. After updating it to React 17 on of the libraries react-data-grid stopped working so I updated that to the latest using the built in Libman. However now when I compile the project I’m getting a bunch of these errors.

Error TS2503 Build:Cannot find namespace ‘React’.
Error TS2503 Build:Cannot find namespace ‘JSX’.

This is obviously a typescript error that seems to indicate the typescript file can’t find react for whatever reason. I’m assuming the react-data-grid is correctly written (even though it’s 7.0b5 a beta version) I’ve tried a bunch of different things but nothing seems to be correcting this issue. I think there’s some fundamental knowledge of typescript and Visual Studio that I’m missing if anyone can point out what’s wrong.

Directory:

Properties wwwroot
     css
     js
        *.jsx files
        site.js
        bootstrap.js
     lib
        bootstrap
        jquery
        react-data-grid
           lib
              bundle.js
              index.d.ts
           package.json
     react
     react-dom
     react-select
     remarkable
Controllers 
Models 
Views 
appsettings.json 
libman.json 
Program.cs 
Startup.cs

Libman:

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "libraries": [
    {
      "library": "[email protected]",
      "destination": "wwwroot/lib/jquery/"
    },
    {
      "library": "[email protected]",
      "destination": "wwwroot/react/"
    },
    {
      "library": "[email protected]",
      "destination": "wwwroot/react-dom/"
    },
    {
      "library": "[email protected]",
      "destination": "wwwroot/remarkable/"
    },
    {
      "provider": "unpkg",
      "library": "[email protected]",
      "destination": "wwwroot/react-select/"
    },
    {
      "provider": "unpkg",
      "library": "[email protected]",
      "destination": "wwwroot/lib/react-data-grid/"
    }
  ]
}

Source: Visual Studio Questions

LEAVE A COMMENT