You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
In pathToArray function, if the path looks like \\SERVER\folder\subfolder\abc.txt, it will throw MemoryFileSystemError(errors.code.EINVAL, path).
This is causing issues with Node.js >= 6.0.0 when bundling with Webpack on a UNC path.
Repro steps:
Mapped \\SERVER\folder to Z:
Setup a webpack.config.js that has an entry based on __dirname
Expected:
Webpack should bundle successfully
Actual:
Node.js >= 6.0.0: Webpack failed because pathToArray does not recognize UNC path
Node.js < 6.0.0: Bundle successfully
This is because under Node.js >= 6.0.0. Any JS modules on a mapped drive Z:, the __dirname will be relative to \\SERVER\folder\, instead of Z:\. And Webpack will fail because memory-fs could not recognize UNC path correctly.
There is currently no workaround as the new behavior on __dirname is consistent across all modules. The only way is to use process.cwd() instead but the solution is limited.
This is a blocking issue for Webpack bundler to run on Azure Web App with Node.js >= 6.0.0.
The correct behavior of pathToArray should be recognizing \\SERVER\folder and turn it into ['\\SERVER', 'folder'].
The text was updated successfully, but these errors were encountered:
In
pathToArray
function, if the path looks like\\SERVER\folder\subfolder\abc.txt
, it will throwMemoryFileSystemError(errors.code.EINVAL, path)
.This is causing issues with Node.js >= 6.0.0 when bundling with Webpack on a UNC path.
Repro steps:
\\SERVER\folder
toZ:
webpack.config.js
that has anentry
based on__dirname
Expected:
Webpack should bundle successfully
Actual:
Node.js >= 6.0.0: Webpack failed because
pathToArray
does not recognize UNC pathNode.js < 6.0.0: Bundle successfully
This is because under Node.js >= 6.0.0. Any JS modules on a mapped drive
Z:
, the__dirname
will be relative to\\SERVER\folder\
, instead ofZ:\
. And Webpack will fail becausememory-fs
could not recognize UNC path correctly.There is currently no workaround as the new behavior on
__dirname
is consistent across all modules. The only way is to useprocess.cwd()
instead but the solution is limited.This is a blocking issue for Webpack bundler to run on Azure Web App with Node.js >= 6.0.0.
The correct behavior of
pathToArray
should be recognizing\\SERVER\folder
and turn it into['\\SERVER', 'folder']
.The text was updated successfully, but these errors were encountered: