gadicc / meteor-phantomjs

Smart package to ensure PhantomJS is automatically installed
25 stars 5 forks source link

PhantomJS doesn't work when deployed. I use select2. #3

Closed gadicc closed 10 years ago

gadicc commented 10 years ago

See https://github.com/gadicc/meteor-phantomjs/issues/1#issuecomment-38037174

Lepozepo commented 10 years ago

Maybe putting it in /public or /client/compatibility would solve that issue

gadicc commented 10 years ago

/public would definitely work, but then you'd have to explicitly include the library with a script tag since it won't get bundled. I guess that's ok though.

/client/compatibility unfortunately won't help. Files in this directory aren't wrapped with a new variable scope, but are still minified as part of the JS bundle sent to the client.

Thanks, it's good to have this explicitly mentioned as alternative to https://github.com/gadicc/meteor-phantomjs/issues/1#issuecomment-38037174.

manybothans commented 10 years ago

I'm also having the same problem as #1. I have tried removing select2 as well as commenting out the DIACRITICS line in the package, no joy. I also tried running uglifyjs to find other problems in the minified code, but it didn't give any errors. Spiderable works in development mode but not production. Does anyone have any other tricks to solve this, or know of other packages causing problems?

gadicc commented 10 years ago

Pretty much everything I've ever come up with, or that has been discussed in the community, is on this page: http://www.meteorpedia.com/read/spiderable

See if anything helps you out, notably the PhantomJS error finding script at the bottom.

manybothans commented 10 years ago

Hey @gadicc, thanks for your reply!

I have gone through that page and tried all the suggestions, including running the phantom test script. I get the repeating "SyntaxError: Parse error" that other people are seeing, but as I said I tried removing select2 as well as commenting out the DIACRITICS line in the package, both did not help. I have no client side errors, and uglifyjs did not throw any errors on my minified javascript. I'm stumped!!

This was my output from the phantom test script, running locally in --production mode:

$ phantomjs phantomtest.js
Loading page...
SyntaxError: Parse error

Page load status: success
SyntaxError: Parse error

not ready, Meteor undefined
SyntaxError: Parse error

SyntaxError: Parse error

Then "SyntaxError: Parse error" just keeps repeating. I thought maybe the "not ready, Meteor undefined" message might be significant, but meteor is definitely working, so I dunno. Any other light you could shed would be amazing!

manybothans commented 10 years ago

I created a blank project and started adding the packages I was using one-by-one to see if another one was causing issues... the culprit was URLify2! I was using that as well as select2, so I was getting the problem from both. Removed both and it works now!

gadicc commented 10 years ago

Hey, that's great news! Thanks for reporting back, hope this helps others too.

brunohstein commented 10 years ago

@manybothans probably not the best place to ask that, but what have you replaced URLify2 with?

manybothans commented 10 years ago

@brunohstein I made my own fork and replaced the problem characters with their unicode codes. Im just using it temporarily until meteor fixes the minification issue. feel free to use it!

https://github.com/manybothans/meteor-urlify2

From your app directory:

mrt remove urlify2
cd packages
mkdir urlify2
git clone https://github.com/manybothans/meteor-urlify2.git urlify2
cd ..
meteor add urlify2