Typescript server rendering introduces css error

import * as React from "react";
import { connect } from "react-redux";
import * as CSSModules from "react-css-modules";
const styles = require("./index.css")
const Home = () => {
  return (
    <div>
    11111
  </div>
  )
}

export default connect(state=>state)(CSSModules(Home, styles))

the error is as follows

clipboard.png

import * as styles from "./index.css";

clipboard.png

if you write index.css.d.ts, the error is shown in figure 1.

ask the bosses


it is obvious that the CSS you loaded cannot be parsed according to the syntax of JS, which is obvious in the prompt.


is such an obvious mistake that you can't see it?


ignore css in the node environment by overriding require.extensions [ext] , or you can use the off-the-shelf library: https://www.npmjs.com/package.

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2bf10-2bac9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2bf10-2bac9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?