Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Not able change entry #468

Closed
lubo08 opened this issue Nov 21, 2017 · 6 comments
Closed

Not able change entry #468

lubo08 opened this issue Nov 21, 2017 · 6 comments

Comments

@lubo08
Copy link

lubo08 commented Nov 21, 2017

I would like to change for node js development index.js to server.js but I get error when I rename index.js to server.js

/home/lubo08/workspace/bimp/node_modules/start-server-webpack-plugin/dist/StartServerPlugin.js:81
var existsAt = compilation.assets[name].existsAt;
^

TypeError: Cannot read property 'existsAt' of undefined
at StartServerPlugin.startServer (/home/lubo08/workspace/bimp/node_modules/start-server-webpack-plugin/dist/StartServerPlugin.js:81:47)
at StartServerPlugin.afterEmit (/home/lubo08/workspace/bimp/node_modules/start-server-webpack-plugin/dist/StartServerPlugin.js:54:12)
at Compiler.applyPluginsAsyncSeries1 (/home/lubo08/workspace/bimp/node_modules/tapable/lib/Tapable.js:222:13)
at Compiler.afterEmit (/home/lubo08/workspace/bimp/node_modules/webpack/lib/Compiler.js:365:9)
at require.forEach.err (/home/lubo08/workspace/bimp/node_modules/webpack/lib/Compiler.js:354:15)
at /home/lubo08/workspace/bimp/node_modules/webpack/node_modules/async/dist/async.js:473:16
at iteratorCallback (/home/lubo08/workspace/bimp/node_modules/webpack/node_modules/async/dist/async.js:1050:13)
at /home/lubo08/workspace/bimp/node_modules/webpack/node_modules/async/dist/async.js:958:16
at /home/lubo08/workspace/bimp/node_modules/graceful-fs/graceful-fs.js:43:10
at FSReqWrap.oncomplete (fs.js:137:15)
neutrino config is

module.exports = {
options: {
// Override to relative file, resolves to options.source + entry.*
entry: 'server',
},
use: [
'neutrino-preset-node',
'neutrino-preset-airbnb-base'
]
};

@helfi92
Copy link
Member

helfi92 commented Nov 21, 2017

Is it possible that compilation.assets[name] is undefined?

@eliperelman
Copy link
Member

I tracked this down, and it's a bug. Even though the option is named entry, when we create the webpack entry with config.entry(), we still use index, i.e. config.entry('index'). This causes the built file to still be index.js, while the start server plugin is looking for server.js.

@eliperelman
Copy link
Member

Fixed with #469. Released in v7.3.3.

@edmorley
Copy link
Member

edmorley commented Nov 21, 2017

For hotfixes in general, what do you think is best: landing on master then backporting, or vice versa? I know of projects that do it both ways, though have a slight preference to the former :-)

@eliperelman
Copy link
Member

I would generally prefer landing on master first then backporting, but I opted for the other approach right now since the packages have completely diverged between master and release.

@lubo08
Copy link
Author

lubo08 commented Nov 21, 2017

Thanks a lot for so fast fix :) working right now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants