javaLuo / react-luo

React Automatically - 保持最新技术 react18 hooks router6 webpack5 babel7 antd4
https://isluo.com/work/pwa/
MIT License
312 stars 71 forks source link

切换成url 模式 模式报错 #31

Closed he5050 closed 5 years ago

he5050 commented 5 years ago

您好,今天刚刚拉下您的项目,在开发模下从hashURL切换到url,强制刷新页面会报错 内容如下

Error: invalid argument
    at pathToArray (E:\github\react-luo\node_modules\memory-fs\lib\MemoryFileSystem.js:44:10)
    at MemoryFileSystem.readFileSync (E:\github\react-luo\node_modules\memory-fs\lib\MemoryFileSystem.js:103:13)
    at MemoryFileSystem.(anonymous function) [as readFile] (E:\github\react-luo\node_modules\memory-fs\lib\MemoryFileSystem.js:300:34)
    at app.get (E:\github\react-luo\server.js:47:31)
    at Layer.handle [as handle_request] (E:\github\react-luo\node_modules\express\lib\router\layer.js:95:5)
    at next (E:\github\react-luo\node_modules\express\lib\router\route.js:137:13)
    at Route.dispatch (E:\github\react-luo\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (E:\github\react-luo\node_modules\express\lib\router\layer.js:95:5)
    at E:\github\react-luo\node_modules\express\lib\router\index.js:281:22
    at param (E:\github\react-luo\node_modules\express\lib\router\index.js:354:14)
he5050 commented 5 years ago

可能output的路径引起的 在output的path相对路径引起的

javaLuo commented 5 years ago

好的,我看看

he5050 commented 5 years ago
 output: {
    path: __dirname + "/", // 将打包好的文件放在此路径下,dev模式中,只会在内存中存在,不会真正的打包到此路径
    publicPath: PUBLIC_PATH, // 文件解析路径,index.html中引用的路径会被设置为相对于此路径
    filename: "bundle.js" // 编译后的文件名字
  },

我修改成为绝对路径了

javaLuo commented 5 years ago

嗯,确实有问题,应该用绝对路径。 但在MAC上是好的..

he5050 commented 5 years ago

好的 那我关了这个issues了