jcoreio / crater

Meteor/Webpack/React SSR app skeleton that runs your app code outside of Meteor Isobuild
ISC License
82 stars 10 forks source link

Problem with 'accounts-facebook' package #134

Closed unski11ed closed 7 years ago

unski11ed commented 7 years ago

I was using this project for some time and it worked great until yesterday.

After adding 'accout-facebook' via atmosphere, the app stopped working. After launch few errors come up in the console:

Cannot read property 'Reload' of undefined - refers to oauth package like this:

//(...)    
/* Imports */
var Meteor = Package.meteor.Meteor;
var global = Package.meteor.global;
var meteorEnv = Package.meteor.meteorEnv;
var check = Package.check.check;
var Match = Package.check.Match;
var _ = Package.underscore._;
var Reload = Package.reload.Reload; //<==== error here
var Base64 = Package.base64.Base64;
var URL = Package.url.URL;
//(...)

and

Cannot read property 'ServiceConfiguration' of undefined in accounts-base packege.

It's worth mentioning, that i have been sucessfully using the accounts-base package before the installation.

I tried to analyze the Webpack compiled app.js, and it seems that there is no Package.reload included in there.

Can you somehow point me towards the right direction of solving this problem?

jedwards1211 commented 7 years ago

Sorry for the delay, I did just manage to repro. I'm looking into it now...I'm wondering if those packages are missing for some reason?

jedwards1211 commented 7 years ago

@unski11ed okay, it's because meteor-imports-webpack-plugin excludes reload. I'll have to patch it.

jedwards1211 commented 7 years ago

@unski11ed okay, if you install the latest version of meteor-imports-webpack-plugin it should fix these errors.

jedwards1211 commented 7 years ago

@unski11ed actually I was wrong, I think getting oauth to work won't be too bad, but I have to fix a few more things. I'll let you know once it's done

jedwards1211 commented 7 years ago

@unski11ed okay, this should be fixed now. Make sure to rerun npm install after merging changes from this repo. Let me know if you have any issues and I'll reopen this. Thanks!

unski11ed commented 7 years ago

God, thanks a lot Mate. My heart stopped when i saw your message about the potential big problems with oauth. Great it turned out to be not so scary ;)

jedwards1211 commented 7 years ago

@unski11ed you're welcome, yeah I'm glad too. I thought oauth relied on injecting some elements into the HTML of any page served up, but I was wrong, it just has to render a template for the oauth routes shown in the popup, not so bad.

And thanks for reporting this, I found a lot of things to improve thanks to this, including making meteor-imports-webpack-plugin import .css files from Meteor packages, serve static assets from Meteor packages, and not import static .js assets.