Webpack compiled build error

Why does test.js (lib/test.js) compiled by webpack go wrong?

fundamental alignment of source code

import React, { Component } from "react"

export default class Test extends Component {
  render() {
    return <h1>Test</h1>
  }
}

erase src/test.js, but make an error after webpack bundle

Error is React.createElement: type is invalid-expected a string

https://github.com/thian4/web.

Feb.28,2021

after reading your question, I began to doubt my Chinese teacher!


clipboard.png
the test.js of your import is packaged. It definitely won't work. You should

import Test from './test'
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-1c229c6-3234b.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-1c229c6-3234b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?