Giter Site home page Giter Site logo

equipment-maintenance-management-system's Introduction

Equipment-maintenance-management-system

201906 实训项目

Fixing the "cannot GET /URL" error on refresh with React Router and Reach Router (or how client side routers work) https://tylermcginnis.com/react-router-cannot-get-url-refresh/

把 index.html 的 js 文件路径:"./main.js"->"/mian.js" 否则请求资源错误: 访问http://localhost:8080/admin/1时请求的基础url是http://localhost:8080/admin。所以在请求main.js时,请求的链接是http://localhost:8080/admin/main.js。实际应该是:http://localhost:8080/main.js

##Confuse 上面提到的请求资源错误,在不更改 index.html 的情况下,若在配置文件中添加插件 HtmlWebpackPlungins,则请求正确。

plugins: [
    new HtmlWebpackPlugin({
      template: "./dist/index.html",
      filename: "index.html"
    })
  ]

但是错误请求仍然会发送。而且访问/admin 时报错

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
    in NavigationBox (created by Route)
    in Route (created by withRouter(NavigationBox))
    in withRouter(NavigationBox) (created by App)
    in div (created by App)
    in Router (created by BrowserRouter)
    in BrowserRouter (created by App)
    in App

如果更改了 index.html 且添加了 HtmlWebpackPlungins 插件,则不会发送错误的请求,warning 没有消失。 所以 warning 应该是因为 HtmlWebpackPlungins 配置错误引起的

equipment-maintenance-management-system's People

Contributors

yolanda-wu avatar

Watchers

 avatar

Forkers

riahtu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.