Comments (13)
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.
@drewlustro Manually editing this file like this has fixed the same issue for me on 3 PC's.
from prerender-spa-plugin.
I haven't encountered this. A minimal example reproducing the problem will definitely help! 🙂
from prerender-spa-plugin.
The 2.0 release was just pushed out, so it's also worth testing that the problem still occurs.
from prerender-spa-plugin.
Sounds great. I'm away from keyboard until mid-january. Will definitely check then.
from prerender-spa-plugin.
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.
@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.
@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.
is this fixed ? i tried like @toverux but it still not work @@
from prerender-spa-plugin.
Hello @lyquocnam ! Could you please provide code to reproduce your issue?
from prerender-spa-plugin.
Are you all including a Promise
polyfill in your own code?
from prerender-spa-plugin.
@alanaasmaa thanks for the info! 👍
from prerender-spa-plugin.
@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)
- Plugin creates broken HTML HOT 1
- Puppeteer Issues on Oracle Linux 8 HOT 2
- Optimization of Puppeteer
- I have a Vue multi-page app, after prerender, all html files look the same. HOT 1
- render each route to an html file
- Only two pages are getting pre-rendered properly
- How to cache the result.
- docker
- on Safari and ios it doesn't always work
- [prerender-spa-plugin] Unable to prerender all routes! HOT 4
- How to configure puppeteer inside prerender-spa for Heroku
- How to launch puppeteer with { args: ['--no-sandbox'] }?
- "/" page flashing before routes load
- Unexpected token '?' with plugin only HOT 2
- Looking for maintainers! HOT 15
- Error during building example app: probably smth with websocket errno: -4039, code: 'ETIMEDOUT'
- Vue Prerender-SPA / Webpack - Application won't initialise with named cacheGroups unless explicitly listed in pages config chunks section?
- why no such file or directory
- Unable to prerender all routes! HOT 2
- Page refresh twice
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 prerender-spa-plugin.