Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Encore 1.0 dev-server failed #893

Closed
kl3sk opened this issue Jan 27, 2021 · 11 comments · Fixed by #899
Closed

Update to Encore 1.0 dev-server failed #893

kl3sk opened this issue Jan 27, 2021 · 11 comments · Fixed by #899
Labels
Bug Bug Fix

Comments

@kl3sk
Copy link

kl3sk commented Jan 27, 2021

Hello,

I try updating my project with the new Encore 1.0, but after trying to update my config I ran on a fail build

Here is the error when I start npm run dev-server

[webpack-cli] Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
 - configuration has an unknown property 'disableHostCheck'. These properties are valid:
   object { bonjour?, client?, compress?, dev?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, injectClient?, injectHot?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, openPage?, overlay?, port?, proxy?, public?, setupExitSignals?, static?, stdin?, transportMode?, useLocalIp? }

Here is the npm log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev-server' ]
2 info using npm@6.14.8
3 info using node@v14.13.1
4 verbose run-script [ 'predev-server', 'dev-server', 'postdev-server' ]
5 info lifecycle @~predev-server: @
6 info lifecycle @~dev-server: @
7 verbose lifecycle @~dev-server: unsafe-perm in lifecycle true
8 verbose lifecycle @~dev-server: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/klesk/<project>/node_modules/.bin:/home/klesk/.npm-global/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
9 verbose lifecycle @~dev-server: CWD: /home/klesk/<project>
10 silly lifecycle @~dev-server: Args: [ '-c', 'encore dev-server' ]
11 silly lifecycle @~dev-server: Returned: code: 2  signal: null
12 info lifecycle @~dev-server: Failed to exec dev-server script
13 verbose stack Error: @ dev-server: `encore dev-server`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:314:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:314:20)
13 verbose stack     at maybeClose (internal/child_process.js:1047:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid @
15 verbose cwd /home/klesk/<project>
16 verbose Linux 4.19.128-microsoft-standard
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "dev-server"
18 verbose node v14.13.1
19 verbose npm  v6.14.8
20 error code ELIFECYCLE
21 error errno 2
22 error @ dev-server: `encore dev-server`
22 error Exit status 2
23 error Failed at the @ dev-server script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

I try to remove node_module and npm install with the same error.

But npm run build works with the same configuration.

Thanks

@mbabker
Copy link

mbabker commented Jan 27, 2021

In the new version of webpack-dev-server, the disableHostCheck option was removed according to their changelog.

@kl3sk
Copy link
Author

kl3sk commented Jan 27, 2021

Thanks I see it. And removed accordingly.

@weaverryan
Copy link
Member

Thanks @mbabker for helping out! webpack-dev-server- along with numerous other libraries - were bumped major versions.

However, I DO think there is a problem in Encore (this upgrade was a late addition). Encore sets a watchOptions, which is now gone in favor of static. That will need to be fixed ASAP.

@weaverryan
Copy link
Member

version 1.0.1 is now out - please let me know if you have any additional issues :).

@kl3sk
Copy link
Author

kl3sk commented Jan 28, 2021

It is better thanks @weaverryan

Maybe due to

Cannot find the CKEditor 5 core translation package (which defaults to `@ckeditor/ckeditor5-core`).` 

The manifest.json file appears few times after the server starts.

I'll investigate more with removing Ckeditor5 package to test if it is related and came back.

But it start better than yesterday 😄

@kl3sk
Copy link
Author

kl3sk commented Jan 28, 2021

Sadly, I retry compiling with and without @CKEditor5 and I can't use my project on Dev env because manifest.json doesn't exists anymore.

image

I wait for long time but nothing appears. I try to tweak webpack-dev-server options without success.

@Kocal
Copy link
Member

Kocal commented Jan 28, 2021

Hi,

I'm also facing issues with the dev-server:
Capture d’écran de 2021-01-28 22-33-27

Like @kl3sk, the file manifest.json does not exist (while file entrypoints.json exist) anymore.
I have 1 compilation warning and it's maybe related to this (see algolia/instantsearch#5394), but it was not blocking with Webpack 4 (not that encore dev works nice):
image

@weaverryan
Copy link
Member

I'll reopen this.

I believe it's caused by .cleanupOutputBeforeBuild(). I can replicate if that is enabled (manifest.json only is missing) but I things work if I remove it.

@weaverryan weaverryan reopened this Jan 29, 2021
weaverryan added a commit that referenced this issue Jan 29, 2021
This PR was merged into the main branch.

Discussion
----------

Working around missing manifest.json bug

This fixes the 2nd part of #893 - #893 (comment)

On Webpack 5, there is some miscommunication between the CleanWebpackPlugin and the WebpackManifestPlugin when using `dev-server`.

The `WebpackManifestPlugin` *does* emit the physical `manifest.json` file, but CleanWebpackPlugin then deletes it. CleanWebpackPlugin should just remove files *before* we start, and not delete anything that's emitted. I'm not sure which plugin has the bug. But, the work around is quite clean.

Commits
-------

a4a6665 Working around missing manifest.json bug
@weaverryan
Copy link
Member

Fixed again - try 1.0.2 :)

@Kocal
Copy link
Member

Kocal commented Jan 29, 2021

I can confirm it's working, thanks!

@kl3sk
Copy link
Author

kl3sk commented Jan 29, 2021

Sorry for the late answer, it works flawlessly ! Thanks again @weaverryan.

But @ckeditor fail as well, this is not relataed directly with Encore I know, is someone have same troubles, I open an issue ckeditor/ckeditor5#8950.

Happy packing 😄 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants