MemoryFileSystemError
See original GitHub issueconst SERVER = require("./www/server.bundle").default;
const express = require("express");
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
// const webpackHotServerMiddleware = require('webpack-hot-server-middleware');
const app = express();
const PORT = 3000;
const compiler = webpack(require('./build/webpack/prod.js'));
app.use(webpackDevMiddleware(compiler));
app.use(webpackHotMiddleware(compiler.compilers.find(compiler => compiler.name === 'client')));
// app.use(webpackHotServerMiddleware(compiler));
app.use(SERVER);
app.listen(PORT, console.log.bind("listening at http://localhost:" + PORT));
If I uncomment the lines (webpackHotServerMiddleware itself) above, my build errors
/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack-dev-middleware/node_modules/memory-fs/lib/MemoryFileSystem.js:112
throw new MemoryFileSystemError(errors.code.EISDIR, _path);
^
Error
at MemoryFileSystem.readFileSync (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack-dev-middleware/node_modules/memory-fs/lib/MemoryFileSystem.js:112:10)
at MultiCompiler.multiCompiler.plugin.multiStats (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack-hot-server-middleware/src/index.js:119:33)
at MultiCompiler.applyPlugins (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/tapable/lib/Tapable.js:25:14)
at MultiCompiler.<anonymous> (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack/lib/MultiCompiler.js:76:10)
at Compiler.applyPlugins (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/tapable/lib/Tapable.js:25:14)
at Watching._done (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack/lib/Compiler.js:93:17)
at /home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack/lib/Compiler.js:76:18
at Compiler.emitRecords (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack/lib/Compiler.js:350:37)
at /home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack/lib/Compiler.js:59:19
at /home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack/lib/Compiler.js:343:11
at next (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/tapable/lib/Tapable.js:118:11)
at Compiler.<anonymous> (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:115:3)
at Compiler.applyPluginsAsyncSeries1 (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/tapable/lib/Tapable.js:122:13)
at Compiler.afterEmit (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack/lib/Compiler.js:340:8)
at Compiler.<anonymous> (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack/lib/Compiler.js:335:14)
at /home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/webpack/node_modules/async/dist/async.js:356:16
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
What are System Error Memory Dump Files in Windows 11/10?
System Error Memory Dump Files are basically error logs that are created whenever your computer crashes. They can hold small amount of ...
Read more >How to Fix This Error: Memory Card Shows Invalid File System
You will need to repair/format raw memory card or recover your data back. Solutions: Memory Card Shows Invalid File System (RAW). 1. Format...
Read more >Memory fs error on windows ==> throw new ... - GitHub
I'm trying to use this package on windows but i keep getting error : throw new MemoryFileSystemError(errors.code.ENOENT, _path).
Read more >How to Fix a File System Error in Windows 10 (Full Guide)
How to fix a file system error on Windows 10 · 1. Check for Windows Updates · 4. Run CHKDSK · 5. Use...
Read more >Fix: The Volume Does Not Contain a Recognized File System ...
This page shows you how to fix The volume does not contain a recognized file system in Windows 10/8/7 with EaseUS RAW drive...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@richardsarrott That’s what I am doing. I just created the express chunk to see if could bundle everything with webpack to get cool syntax, but you are right. It’s not worth it.
I ended up doing
So with
NODE_ENV=production
I endup with a single server bundle with all the dependencies. Its especially good for docker, because instead of doingI can
For this the client/middleware/server.tsx files live inside the src dir while I keep a hot.js file on my root. Not having hmr logic inside the app source code makes sense for me.