-
Notifications
You must be signed in to change notification settings - Fork 4
Unable to get prerendering working with HtmlWebpackPlugin #14
Comments
Hi, thanks for your nice words Your project is compiling fine, your issue is coming from iampava/imagemin-webp-webpack-plugin#62 If you comment the ImageMinWebpPlugin it you'll see it goes away, you could use |
@Tofandel Thanks for your reply. I got rid of the obsolete The issue persists, but you are right that this is probably not directly related to the pretender plugin itself. I created a new docker container and tried to build it within the container, and it succeeded with no issues. So this might be Windows related, as I use Windows on my dev machine, and of course, Windows uses case insensitive file system. Thanks for your time! |
I see, try clearing your node_modules and reinstalling just in case If the issue is still there consider changing your windows username dir |
Otherwise I might have a suspicion If you can add a And run your build and paste the output of the log, if there is differences in directory separator there, this is the source of the issue |
Thanks, I've already tried exactly that - new clone of the repo to As for the user name - that's just standard behavior of Windows 10 if you log in with your Microsoft credentials when creating the windows account. :/ I decided to keep it this way to see how it works and what causes problems. Because I figured that if I change it to something more standard and easier to use, I will have an easier life, but sooner or later I will encounter a client with this name (accents, spaces) in their home directory. So I just want to be prepared and sure that my apps work in this scenario. As for the log, here it is:
Thanks! |
Okay then I see your issue in the log, its trying to output to |
Can you try the new version? |
Brilliant, work like a charm! I've tested the build on Windows, Docker, and CI/CD AWS Pipeline builder. All three were completed with no errors. Thanks again! |
Hello @Tofandel, first of all, thank you for your efforts in migrating the prerender plugin to webpack 5.
I've tried to migrate my project from webpack 4 to webpack 5 today, but with no luck.
The problem seems to be the combination of the HtmlWebpackPlugin and PrerenderSPAPlugin - I use a very similar setup as provided in original examples, such as here: https://github.com/Tofandel/prerender-spa-plugin-next/blob/master/examples/vue2-webpack-router/webpack.config.js.
The problem seems to be that first, HtmlWebpackPlugin writes to
dest/index.html
when compiling the template, and then PrerenderSPAPlugin attempts to rewrite the file with the pre-rendered content. This results in the following error message(s):Have you encountered this error? Do you have any idea what I can do to solve this? It is entirely possible this is some kind of error or obscure usage of the plugins in my project, but right now, I can't see any error in my config.
You can check out my project config for webpack 4 (functioning) here: https://github.com/oookoook/nastojte-cz/blob/master/webpack.config.js
And webpack 5 config (nonfunctioning) here: https://github.com/oookoook/nastojte-cz/blob/webpack5/webpack.config.js
I'm not experienced enough with webpack to solve this issue... Maybe I got some dependencies wrong? I have no idea... If I understand correctly, I can't get rid of the HtmlWebpackPlugin - that's the plugin that injects the JS script into the template...
Thanks in advance!
The text was updated successfully, but these errors were encountered: