Comments (6)
Man, sorry for the bad language, but fuck IE. D:
The culprit seems to be the Event
constructor, so it seems that a simple polyfill should be good to fix that. For now a workaround is to set useRenderEvent
to false and to delete the line.
from vue-cli-plugin-prerender-spa.
Well, you could always add a check to see if it's pre-rendering (I believe prerender-spa
injects a property into window
), but that would have been more source code manipulation than I'd be comfortable with without switching to AST transforms anyway; actually I haven't thought about that before. Since it's done the way it is now, and possibly there could be other uses to an event like this, I'm gonna leave it as is.
I'm merging the PR and will work towards getting a minor version bump out, thanks for the issue!
from vue-cli-plugin-prerender-spa.
Does the render event serve any purpose (If our app isn't using it?)
Android Browser <5 also triggers an error. (but the Event function does exists). Added a try/catch block for android around a solution found on: https://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
function createNewEvent(eventName) {
var event;
if (typeof (Event) === 'function') {
try {
event = new Event(eventName);
} catch (e) {
event = document.createEvent('Event');
event.initEvent(eventName, true, true);
}
} else {
event = document.createEvent('Event');
event.initEvent(eventName, true, true);
}
return event;
}
from vue-cli-plugin-prerender-spa.
The render event is used to tell Pupeteer that the app has finished rendering to DOM - basically a trigger to save the snapshot to disk.
Please try #41, I have had to write a more proper source file transform operation given how much code I was going to, well, transform. I've also included your polyfill (which was what I had found, but without the try/catch block) - so try to break it because since I'm transforming AST instead of just naive string manipulation, this should support many more use-cases.
from vue-cli-plugin-prerender-spa.
Works great! Not able to break it yet, Thank you. Nice PR description :)
The render event is used to tell Pupeteer that the app has finished rendering to DOM - basically a trigger to save the snapshot to disk.
If that's all, isn't it easier to just not trigger this event (except while running the build?)
from vue-cli-plugin-prerender-spa.
Ran in to this issue several times this week with IE11 users, sadly i do need to support them. Does the latest release handle this issue, i.e 1.16 I know this issue was fixed in #41 but im not sure how to access that with npm as the latest official is 1.16. Sorry not familiar with accessing other versions , please help.
from vue-cli-plugin-prerender-spa.
Related Issues (20)
- Meta information HOT 1
- Not working with vue cli 4.4 HOT 2
- Does it support with the route has params?
- Missing index.html when redirecting routes with vi18n HOT 2
- failed to launch chrome in heroku
- Missing the index.html and built dir is not correct too HOT 1
- FreeBSD Compatibility HOT 1
- index.html scripts get called twice
- How to remove the module HOT 4
- Error: Cannot call .tap() on a plugin that has not yet been defined. Call plugin('html').use(<Plugin>) first. HOT 6
- Prerender for router with webhash history mode
- How do you handle styles?
- Unable to prerender all routes!
- Meta Information HOT 2
- CI/CD Error: EACCES: permission denied, rmdir '/my-project/dist'
- e2e tests fail with latest vue-cli + vue-prerender-spa-plugin HOT 1
- Cannot set property 'execStart' of undefined
- Add server configuration options HOT 1
- Not triggered on different env? HOT 4
- Can't Submit form alway reloading when button click
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-cli-plugin-prerender-spa.