Coder Social home page Coder Social logo

Comments (6)

SolarLiner avatar SolarLiner commented on June 16, 2024 1

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.

SolarLiner avatar SolarLiner commented on June 16, 2024 1

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.

blaaat avatar blaaat commented on June 16, 2024

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.

SolarLiner avatar SolarLiner commented on June 16, 2024

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.

blaaat avatar blaaat commented on June 16, 2024

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.

ricky11 avatar ricky11 commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.