alienzhou / web-highlighter

✨ A no-runtime dependency lib for text highlighting & persistence on any website ✨🖍️
https://alienzhou.github.io/web-highlighter/
MIT License
888 stars 144 forks source link

Error occured when npm start #89

Closed kyupid closed 2 years ago

kyupid commented 3 years ago
~/Documents/projects/web-highlighter(master) » npm start

> web-highlighter@0.7.4 start
> node script/dev.js

[convert] /Users/kyu/Documents/projects/web-highlighter/README.md - converting...
[convert] /Users/kyu/Documents/projects/web-highlighter/README.md - convert md to html success!
/Users/kyu/Documents/projects/web-highlighter/script/dev.js:11
WebpackDevServer.addDevServerEntrypoints(config, serverConfig);
                 ^

TypeError: WebpackDevServer.addDevServerEntrypoints is not a function
    at Object.<anonymous> (/Users/kyu/Documents/projects/web-highlighter/script/dev.js:11:18)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47

It happens in every versions you released, and I don't know how to solve this problem.

alienzhou commented 3 years ago

.addDevServerEntrypoints() was removed from v4 in webpack-dev-server.

v4 is installed because of the declaration in package.json below:

https://github.com/alienzhou/web-highlighter/blob/1dbe0c3a61acff3d116731b0ab406211320fc5aa/package.json#L92


You may fix it by installing webpack-dev-server manually (after npm i).

npm i webpack-dev-server@3

I'll fix it later.

kyupid commented 3 years ago

Thank you for the detailed explanation.