错误:React Server Side Rendering中没有此类文件或目录

时间:2018-03-10 09:10:18

标签: reactjs webpack serverside-rendering react-server

我尝试在现有的反应项目上进行服务器端渲染,但遇到问题。

我认为问题是内存-fs无法找到文件或目录。我已阅读很多帖子,但到目前为止还没有运气。

以下是错误

/var/www/nodejs/rivigo_main/node_modules/memory-fs/lib/MemoryFileSystem.js:114
            throw new MemoryFileSystemError(errors.code.ENOENT, _path);
            ^
Error: no such file or directory
    at MemoryFileSystem.readFileSync (/var/www/nodejs/rivigo_main/node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
    at serverCompiler.run (/var/www/nodejs/rivigo_main/server.js:34:25)
    at emitRecords.err (/var/www/nodejs/rivigo_main/node_modules/webpack/lib/Compiler.js:269:13)
    at Compiler.emitRecords (/var/www/nodejs/rivigo_main/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/var/www/nodejs/rivigo_main/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/var/www/nodejs/rivigo_main/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/var/www/nodejs/rivigo_main/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/var/www/nodejs/rivigo_main/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at next (/var/www/nodejs/rivigo_main/node_modules/tapable/lib/Tapable.js:220:14)
    at Compiler.<anonymous> (/var/www/nodejs/rivigo_main/node_modules/copy-webpack-plugin/dist/index.js:190:13)
    at next (/var/www/nodejs/rivigo_main/node_modules/tapable/lib/Tapable.js:220:14)
    at Compiler.<anonymous> (/var/www/nodejs/rivigo_main/node_modules/copy-webpack-plugin/dist/index.js:190:13)
    at Compiler.applyPluginsAsyncSeries1 (/var/www/nodejs/rivigo_main/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/var/www/nodejs/rivigo_main/node_modules/webpack/lib/Compiler.js:365:9)
    at require.forEach.err (/var/www/nodejs/rivigo_main/node_modules/webpack/lib/Compiler.js:354:15)
    at /var/www/nodejs/rivigo_main/node_modules/async/dist/async.js:473:16
    at iteratorCallback (/var/www/nodejs/rivigo_main/node_modules/async/dist/async.js:1050:13)
    at /var/www/nodejs/rivigo_main/node_modules/async/dist/async.js:958:16
    at MemoryFileSystem.writeFile (/var/www/nodejs/rivigo_main/node_modules/memory-fs/lib/MemoryFileSystem.js:328:9)
    at writeOut (/var/www/nodejs/rivigo_main/node_modules/webpack/lib/Compiler.js:343:28)
    at Immediate._onImmediate (/var/www/nodejs/rivigo_main/node_modules/memory-fs/lib/MemoryFileSystem.js:288:4)
    at runCallback (timers.js:794:20)

1 个答案:

答案 0 :(得分:0)

您不应访问(xenial)vash@localhost:~/python/AtBS$ python3.7 pattern.py odds_evens = (2, 1) 。是私人的而是重写请求。