Giter Site home page Giter Site logo

Comments (13)

toverux avatar toverux commented on July 1, 2024 4

I've also had that ReferenceError: Can't find variable: Promise error, I've fixed it (before seeing this issue) by adding core-js' Promise polyfill in my app.

import 'core-js/es6/promise';

@chrisvfritz are you saying that I shouldn't do that just to support Phantom?

from prerender-spa-plugin.

alanaasmaa avatar alanaasmaa commented on July 1, 2024 1

@drewlustro Manually editing this file like this has fixed the same issue for me on 3 PC's.

85d7d8c

from prerender-spa-plugin.

chrisvfritz avatar chrisvfritz commented on July 1, 2024

I haven't encountered this. A minimal example reproducing the problem will definitely help! 🙂

from prerender-spa-plugin.

chrisvfritz avatar chrisvfritz commented on July 1, 2024

The 2.0 release was just pushed out, so it's also worth testing that the problem still occurs.

from prerender-spa-plugin.

nimser avatar nimser commented on July 1, 2024

Sounds great. I'm away from keyboard until mid-january. Will definitely check then.

from prerender-spa-plugin.

u12206050 avatar u12206050 commented on July 1, 2024

I might also have this issue even on V2.0, I have the following code where I am using require

Vue.component('login', function (resolve) {
  require(['./login.vue'], resolve)
})

this is so I can lazy load the login component.

The code works, but prerender doesn't generate any prerendered html on any of my paths, in fact when ever I have another route besides '/' that I want prerender, the build just never stops without any warnings or errors even after waiting for more than 30 minutes.

After removing the require statement I get the following error on build:

node_modules/prerender-spa-plugin/lib/compile-to-html.js:80
                    if (error) throw stdout
                               ^
WARNING: JavaScript error while prerendering: /
ReferenceError: Can't find variable: Promise

  phantomjs://code/phantom-page-render.js:26 in onError

from prerender-spa-plugin.

chrisvfritz avatar chrisvfritz commented on July 1, 2024

@u12206050 I think you're getting a different problem. We use core-js to polyfill Promise and other features, but in your case, Promise is undefined when your script runs. 😕 I'll try to look into this soon.

from prerender-spa-plugin.

u12206050 avatar u12206050 commented on July 1, 2024

@chrisvfritz Thanks, have you been able to find out anything? I know that the use of vue-material is currently limiting my chances of getting any sort of prerendering working.

from prerender-spa-plugin.

lyquocnam avatar lyquocnam commented on July 1, 2024

is this fixed ? i tried like @toverux but it still not work @@

from prerender-spa-plugin.

drewlustro avatar drewlustro commented on July 1, 2024

Hello @lyquocnam ! Could you please provide code to reproduce your issue?

from prerender-spa-plugin.

drewlustro avatar drewlustro commented on July 1, 2024

Are you all including a Promise polyfill in your own code?

from prerender-spa-plugin.

drewlustro avatar drewlustro commented on July 1, 2024

@alanaasmaa thanks for the info! 👍

from prerender-spa-plugin.

drewlustro avatar drewlustro commented on July 1, 2024

@niwolive @u12206050 @lyquocnam @alanaasmaa – this has been fixed in #54, which was merged in last week and published on npm.

Cheers.

from prerender-spa-plugin.

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.