Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server side rendering: google is not defined #10

Open
jwamsterdam opened this issue Oct 11, 2017 · 5 comments
Open

Server side rendering: google is not defined #10

jwamsterdam opened this issue Oct 11, 2017 · 5 comments

Comments

@jwamsterdam
Copy link

Hi,
Your npm works great running locally, but using SSR with node I get the following error:

ReferenceError: google is not defined
at new t (C:\tripnew\node_modules\material-ui-places\lib\material-ui-places.min.js:1:2370)

any change to fix this?

Thanks a lot!

@jwamsterdam
Copy link
Author

Hi @ydeshayes,

Do you think you can help out here? I love your npm and would really like to keep using it!

@ydeshayes
Copy link
Owner

Hello!

When is your error firing, at run time or bundle time ?

Do you have the ability to load the google script in the HTML that you return to the browser ?

Sorry for the delay...

@ydeshayes
Copy link
Owner

Can you try to add google as external on window.google ?

@jwamsterdam
Copy link
Author

Hi,

Will check if the error is on runtime or buildtime, I do have the script in my html.
Do not completely undertsand your second answer.. how do I configure that?

@jwamsterdam
Copy link
Author

The error is on runtime, building goes oke.
Below is the more detailed error:

C:\Tripscanner2\node_modules\material-ui-places\lib\material-ui-places.min.js:1
(function (exports, require, module, __filename, __dirname) { !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("material-ui"),require("prop-types"),require("react")):"function"==typeof define&&define.amd?define("material-ui-places",["material-ui","prop-types","react"],t):"object"==typeof exports?exports["material-ui-places"]=t(require("material-ui"),require("prop-types"),require("react")):e["material-ui-places"]=t(e["material-ui"],e["prop-types"],e.react)}(this,function(e,t,r){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants