question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Phantom can not parse LESS

See original GitHub issue

I am using webshot to try to generate a screenshot of a website that is compiling LESS on the client machine. However this fails. webshot uses Phantom.js as an underlying mechanism.

For example when I target this Fiddle http://jsfiddle.net/Yhcz4/23/ I get the following Phantom error in the initFunctions function (when I remove this line other unrelated errors pop up)

TypeError: 'undefined' is not a function (evaluating '_math.bind(null, Math[f], mathFunctions[f])')

What am I doing wrong. Or is Phantom JS simply not able to work with Less.js?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
clementgarniercommented, Apr 2, 2014

I ran into the exact same bug today and it seems to be related to this issue: https://github.com/ariya/phantomjs/issues/10522

tl; dr: the Webkit version used by PhantomJS is missing the Function.prototype.bind implementation.

I suppose this is not triggered while testing less using PhantomJS simply because the initFunctions() function is not tested, and it is the only one using bind().

This seems to work for me: https://github.com/ariya/phantomjs/issues/10522#issuecomment-16125397

0reactions
seven-phases-maxcommented, Jan 22, 2016

@RALifeCoach

Could you also please provide an example of what that shim might look like

It’s a “standard” ES5 polyfill script: es-5 shim (The link is right in the doc section @lukeapage pointed to).

Read more comments on GitHub >

github_iconTop Results From Across the Web

CasperJS "Syntax error: Parse error" - Stack Overflow
CasperJS "Syntax error: Parse error" ... I've looked up some possible explanations, I added the phantom.cookiesEnabled = true, but I simply can't figure...
Read more >
Phantomjs does not exit if file has Parse Errors #10687 - GitHub
I'm not sure about the loader script, but I want to know is placing phantom.onError directly on the executing script, real_script.js in ths...
Read more >
Data access automation API - Splunk Documentation
Why I can't access data from Splunk using REST API. ... phantom.collect(container, #this can be a container or an action results object ...
Read more >
Phantom types in Swift - Swift by Sundell
This week, let's take a look at a technique that can let us leverage Swift's type system to perform data validation at compile...
Read more >
Phantom Wallet Solana Tutorial - Complete Beginner's Guide ...
The content published on CoinSutra Channel is for informational, educational, and recreational purposes only and should not be considered to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found