Skip to content

Commit

Permalink
Fix: client plugins crashing hoodie server in Windows (#867)
Browse files Browse the repository at this point in the history
In Windows adding a client plugin as described in http://docs.hood.ie/en/latest/guides/plugins.html will crash hoodie server with error
Error: Cannot find module 'C:UsersUserdevhoodie-serverhoodieclient' as backslashes in Windows paths are collapsed when building the string hoodieBundleSource. The fix replaces backslashes in the paths with forward slashes which work both in Linux and Windows.
  • Loading branch information
drodsou authored and gr2m committed Mar 26, 2019
1 parent 24a2eb2 commit b897d3c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/plugins/client/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function bundleClient (hoodieClientPath, bundleTargetPath, options, callback) {

var plugins = [path.resolve('hoodie/client')]
.concat(pluginPaths)
.map(p => p.replace(/\\/g,"/") ) // fix backslashes in Windows paths
.filter(checkModule)

var getPluginsModifiedTimes = plugins.map(function (pluginPath) {
Expand Down

0 comments on commit b897d3c

Please sign in to comment.