-
Notifications
You must be signed in to change notification settings - Fork 25
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
TypeError: Cannot set property of 'template' of undefined #24
Comments
When looking at code
} |
I'm running into a similar issue. I converted my website to a multi page setup and this plugin stopped working in the same line. I still have public/index.html but it still crashes for the same reason. |
In multi page mode vue creates different objects for every 'page' I noticed I have
rather than just html changing the line
to
allows to the plugin to keep working, although I am unsure at what side effect problems it creates. |
Any update on this? The change above works but why is it needed? |
because the plugin expects your app to be under index. if you change your app name or have a multi page app, the plug n is unable the right webpack module? to process. I don't know a lot about the webpack process so i can't give you a more precise answer. |
I'm really sorry I have not gotten any notifications for this (or any project I maintain or follow) in the past months, I'm sorry I've missed all of this. Regarding multi-page setups, I don't really know how to approach this. I feel like this plugin was written too much with single-page in mind and don't really know how to proceed; should the plugin prerender all pages? One page only? How to make a selection of pages that is convenient enough. I'm open to suggestions! |
Hi @SolarLiner no worries, I am not sure how feasible my suggestion is but I think that vue cli parcels every page as its own object while processing in webpack. So in theory in the prerender config renderRouters we should be able to define pages as Alternatively a nested dictionary
|
This sounds good to me - however what should be done when not all keys are defined in renderRoutes ? |
Not sure I understand your question but in renderroutes if a route is missing you do not render it? Don't think that changes as per current implementation. Once you go the multi page route all pages must be defined ill post my current config as an example.
So with the proposed changes renderroutes would look something like this
or
which ever is easier to implement :) Thinking about it more I imagine a challenge would be to auto detect if the project is a single page or a multi page setup. |
I've occured same error when using pug template. I have My config is as so: pages: {
index: {
entry: './src/main.js',
template: './src/index.pug'
}
} |
Didnt work for me even after this change
|
Any update? |
yes I have the same issue as well ... any update? |
I get this Error:
I am using a normal vue-cli based project using multiple pages (and no main.js)
The text was updated successfully, but these errors were encountered: