I get the below error when trying to run react-snap, I can see alot of people that have run into similar issues but I haven't seen a solution to fix this so far.
It builds to a folder called dist and removing the whole folder it will still generate this error
How can I get fix this error?
error at /404.html/austrian-cruelty-free-hbo-bag { Error: EEXIST: file already exists, mkdir 'C:\Users\Tom\Desktop\projects\boho\dist\404.html'
at Object.mkdirSync (fs.js:729:3)
at sync (C:\Users\Tom\Desktop\projects\boho\node_modules\mkdirp\index.js:71:13)
at Function.sync (C:\Users\Tom\Desktop\projects\boho\node_modules\mkdirp\index.js:77:24)
at saveAsHtml (C:\Users\Tom\Desktop\projects\boho\node_modules\react-snap\index.js:565:12)
at process._tickCallback (internal/process/next_tick.js:68:7)
errno: -4075,
syscall: 'mkdir',
code: 'EEXIST',
path: 'C:\\Users\\Tom\\Desktop\\projects\\boho\\dist\\404.html' }
package.json
"reactSnap": {
"source": "dist",
"minifyHtml": {
"collapseWhitespace": false,
"removeComments": false
}
},
routes
<Switch location={location}>
<Route exact path="/" render={props =>
<Home e={e} p={p}
categories={categories}
subCategories={subCategories}
products={products}
language={language}
{...props} />} />
<Route exact path="/delivery" component={Delivery}/>
<Route exact path="/dostawa" component={Delivery}/>
<Route exact path="/terms" component={Terms}/>
<Route exact path="/privacy" component={Privacy}/>
<Route exact path="/about" component={About}/>
<Route exact path="/:catId" render={props => <ProductsList e={e} p={p} categories={categories} subCategories={subCategories} products={products} showAlert={showAlert} language={language} {...props} />} />
<Route exact path="/:catId/:productId" render={props => <Product categories={categories} subCategories={subCategories} products={products} showAlert={showAlert} language={language} {...props} />} />
</Switch>