catamphetamine / universal-webpack

Isomorphic Webpack: both on client and server
MIT License
684 stars 48 forks source link

Fails to run server using DllPlugin, "ReferenceError: vendor is not defined" #97

Open AndrewRayCode opened 6 years ago

AndrewRayCode commented 6 years ago

My webpack dev config contains:

    new webpack.DllReferencePlugin({
      context: path.join(__dirname, '../'),
      manifest: require(
        '../static/dist/manifests/vendor-manifest.json',
      ),
    }),

(this file exists) - the webpack client and server watchers seem to be working, but when I start my server:

nodemon ./bin/server --watch ./dist/server
[nodemon] starting `node ./bin/server.js`

ReferenceError: vendor is not defined
    at Object.<anonymous> (dist/server.js:43:95)
    at o (dist/server.js:1:186)
    at Object.<anonymous> (dist/server.js:37:97)
    at o (dist/server.js:1:186)
    at Object.<anonymous> (dist/server.js:31:4524)
    at o (dist/server.js:1:186)
    at Object.<anonymous> (dist/server.js:13:182)
    at o (dist/server.js:1:186)
    at dist/server.js:1:1012
    at Object.<anonymous> (dist/server.js:1:1021)

The line it's barfing on:

/*!************************************************************************************!*\
  !*** delegated ./node_modules/webpack/buildin/module.js from dll-reference vendor ***!
  \************************************************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,d,o){e.exports=o(/*! dll-reference vendor */6)(127)},
/*!*************************!*\
  !*** external "vendor" ***!
  \*************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,d){e.exports=vendor},

Edit: same behavior if I add name: 'vendor', to the DllPlugin. Both the client and server bundle seem to build fine