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

Error: Content placeholder not found in template. #13

Closed
yekver opened this issue Aug 30, 2018 · 4 comments
Closed

Error: Content placeholder not found in template. #13

yekver opened this issue Aug 30, 2018 · 4 comments

Comments

@yekver
Copy link
Contributor

yekver commented Aug 30, 2018

Comment <!--vue-ssr-outlet--> is deleted in production build and SSR is not working. This can be fixed by renaming file index.html back to index.template.html.

@Akryum Akryum closed this as completed in f50bb03 Aug 31, 2018
@sneko
Copy link

sneko commented May 4, 2019

@Akryum @yekver I'm using the version 0.3 and I'm having this issue even by renaming it to index.template.html.

Maybe I'm doing something wrong... Firstly I'm building the project and then serving it like that:

cross-env NODE_ENV=production vue-cli-service ssr:build
cross-env NODE_ENV=production vue-cli-service ssr:serve

And that's when serving I get the error Error: Content placeholder not found in template.. When looking inside the dist/index.html there is no <!--vue-ssr-outlet-->.

I could first build as NODE_ENV=development and then serve as NODE_ENV=production but it doesn't make sense this the source code is not minified when reaching it in my browser.

Do you have an idea what could be the origin of this 🤔 ?

Thank you,

@sneko
Copy link

sneko commented Jun 9, 2019

Unfortunately I'm still stuck with this issue 😢

I'm trying to debug step by step to see what's going wrong...

@sneko
Copy link

sneko commented Jun 9, 2019

https://github.com/Akryum/vue-cli-plugin-ssr/blob/master/lib/webpack.js#L14
https://github.com/Akryum/vue-cli-plugin-ssr/blob/v0.3.0/lib/webpack.js#L14

I guess that's because the condition is about the mode and not the process.env.NODE_ENV. In my case I use "dev/prod" as mode since I had 1 year ago conflicts to run PWA properly in both mode with Vue.js.

@hmillison
Copy link
Contributor

This is still an issue if you have multiple modes that need the production build (for multiple environment), it would be preferable to switch to detecting the isProd flag via NODE_ENV instead of mode.

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

No branches or pull requests

3 participants