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

No prerender when baseURL variable is set in vue.config.js #6

Closed
madjidtaha opened this issue Sep 24, 2018 · 6 comments · Fixed by #9
Closed

No prerender when baseURL variable is set in vue.config.js #6

madjidtaha opened this issue Sep 24, 2018 · 6 comments · Fixed by #9
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@madjidtaha
Copy link

Describe the bug
No prerender are triggered when baseURL variable is set. Build is created as normal as when the plugin is not installed but the console keeps waiting on the sentence "Building for production"

To Reproduce
Steps to reproduce the behavior:

  1. vue create example
  2. cd example
  3. vue add prerender-spa
  4. Create a vue.config.js file in the root of the project
  5. Fill vue.config.js with this.
module.exports = {
  baseUrl: '/example/',
}; 
  1. npm run build

Expected behavior
Build the project and prerender the project with the correct url

Additional context
Package version: 1.0.2
Vue version: 2.5.17
Vue CLI version: 3.0.1

@SolarLiner SolarLiner added enhancement New feature or request help wanted Extra attention is needed labels Sep 24, 2018
@SolarLiner
Copy link
Owner

Currently, you'd need to specify the URLs with the Base URL into the array of pages to pre-render. I'd need to somehow be able to get the base URL from the configuration to update the routes array.
I'd need to dig into the docs again to see if the configuration files do provide it, otherwise, I'd need to parse the files - which means I'd need to set up an actual parser for this and other issues.

@SolarLiner SolarLiner added this to the 1.1.0 milestone Sep 24, 2018
@madjidtaha
Copy link
Author

I just tried again with headless: false and with the same route as the baseURL,

I don't know which server is used to mount the build to allow Puppeter to prerender the page but it seems that this server did not mount the folder on the baseURL so, that's why it cannot access to the assets.

I join some screenshot, it might be helpful.

Thanks for your help
screen shot 2018-09-25 at 01 48 56
screen shot 2018-09-25 at 01 42 20
screen shot 2018-09-25 at 01 42 21

SolarLiner pushed a commit that referenced this issue Sep 29, 2018
@jpicton
Copy link

jpicton commented Oct 19, 2018

Do you have a timeline for a release that contains this fix?

@SolarLiner
Copy link
Owner

I'll cherrypick the changes into a hotfix release, stay tuned.

@SolarLiner
Copy link
Owner

Version 1.0.3 is out, check it out!

@jpicton
Copy link

jpicton commented Nov 27, 2018

Cheers! The hotfix works like a charm. 👍

SolarLiner added a commit that referenced this issue Jan 2, 2019
Version 1.1.0

- Adds support for user post-processing of HTML after pre-rendering #4
- Bundles an `app.html` file which is not prerendered, and should be used as
 entrypoint for non-prerendered routes #14
- Support multi-page mode (by @snadn) #10 (implementation #11)
- Support non-default baseURL (by @snadn) #6 (implementation #9)
- Writes configuration using the API `extendPackage` function, which writes to
 `vue.config.js`. If found, the old configuration will be copied over and
 converted on `vue invoke` (and read, but not converted on build).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants