简体   繁体   English

为什么反应 mui 分页组件会导致无法在“文档”上执行“createElement”:提供的标签名称 (“/.js”) 不是有效名称。 错误?

[英]Why react mui pagination component causes Failed to execute 'createElement' on 'Document': The tag name provided ('/.js') is not a valid name. error?

I am using mui for my react project.我正在为我的 React 项目使用 mui。 When i am using button component of mui it is working but pagination component creates this error:当我使用 mui 的按钮组件时,它正在工作,但分页组件会产生此错误:

DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('/7f3bb9f17db538730cfa2032641aa64e.js') is not a valid name. DOMException:无法在“文档”上执行“createElement”:提供的标签名称(“/7f3bb9f17db538730cfa2032641aa64e.js”)不是有效名称。

In another project which is created with create-react-app is working but this is not working.在另一个使用 create-react-app 创建的项目中正在运行,但这不起作用。

I tried lots of things like reinstall node_modules, searched for any clue about mui in webpack but could not solve the problem.我尝试了很多事情,比如重新安装 node_modules,在 webpack 中搜索有关 mui 的任何线索,但无法解决问题。

import React from 'react'
import Pagination from '@mui/material/Pagination';
import './index.css'

const Table = () => {


  return (
    <div className='table'>
        <Pagination count={10} variant="outlined" color="primary" />

    </div>
  )
}

export default Table

I was using file-loader for svg,img.. in webpack but it should be url-loader我正在为 svg 使用文件加载器,img .. 在 webpack 但它应该是 url-loader

before:前:

    {
        test: /\.png|svg|jpg|gif$/,
        use: ["file-loader"],
    },

after:后:

    {
        test: /\.(jpe?g|gif|png|svg)$/i,
        use: [
        {
          loader: 'url-loader',
          options: {
            limit: 10000
          }
        }
      ]
    },

note: do not forget to install url-loader..注意:不要忘记安装 url-loader..

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React Uncaught DOMException:无法在“文档”上执行“createElement”:提供的标签名称(“<div> &#39;) 不是有效名称 - React Uncaught DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('<div>') is not a valid name 无法导入图像:InvalidCharacterError:无法在“文档”上执行“createElement”:提供的标签名称不是有效名称 - Unable to import images: InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided is not a valid name 未捕获的 DOMException:无法在“文档”上执行“createElement”:提供的标签名称 - Uncaught DOMException: Failed to execute 'createElement' on 'Document': The tag name provided InvalidCharacterError:无法在“文档”上执行“createElement”:提供的标记名称(“/static/media/tab1.fab25bc3.png”)不是有效名称 - InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('/static/media/tab1.fab25bc3.png') is not a valid name InvalidCharacterError:无法在“文档”上执行“createElement”:提供的标签名称(“/static/media/index.c6592bb6.ts”)不是有效名称 - InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('/static/media/index.c6592bb6.ts') is not a valid name InvalidCharacterError:无法在“文档”上执行“createElement”:提供的标签名称(“/static/media/avatar.6043f57a.png”)不是有效名称 - InvalidCharacterError: Failed to execute 'createElement' on 'Document':The tag name provided ('/static/media/avatar.6043f57a.png') is not a valid name d3 react js-无法在“文档”上执行“ createElementNS”:提供的限定名称包含无效字符“,” - d3 react js - Failed to execute 'createElementNS' on 'Document': The qualified name provided contains the invalid character ',' React SVG 提供的标签名称无效 - React SVG tag name provided is not valid React Storybook SVG 无法在“文档”上执行“createElement” - React Storybook SVG Failed to execute 'createElement' on 'Document' 在 React 中将组件名称注入标签 - Injecting Component name into tag in React
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM