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

yarn build:src fails #844

Open
gergely-ujvari opened this issue Jun 6, 2018 · 5 comments · May be fixed by #952
Open

yarn build:src fails #844

gergely-ujvari opened this issue Jun 6, 2018 · 5 comments · May be fixed by #952

Comments

@gergely-ujvari
Copy link

if trying to run yarn build:src, it fails, with the following error message:

$ yarn build:src
yarn run v1.7.0
$ babel-node src/tx/jscodeshift
Generating src/components/addons/MarkerWithLabel.jsx from src/macros/addons/MarkerWithLabel.jsx
TypeError: Invalid attempt to destructure non-iterable instance
    at /home/ujvari/git/01/react-google-maps/node_modules/babel-runtime/helpers/slicedToArray.js:48:13
    at contentToJS (/home/ujvari/git/01/react-google-maps/src/tx/ClassDefinition.js:26:46)
    at /home/ujvari/git/01/react-google-maps/src/tx/ClassDefinition.js:18:12
    at tryCatcher (/home/ujvari/git/01/react-google-maps/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/ujvari/git/01/react-google-maps/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/ujvari/git/01/react-google-maps/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/home/ujvari/git/01/react-google-maps/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/ujvari/git/01/react-google-maps/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/home/ujvari/git/01/react-google-maps/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/home/ujvari/git/01/react-google-maps/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/ujvari/git/01/react-google-maps/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
    at process.topLevelDomainCallback (domain.js:121:23)
child_process.js:643
    throw err;
    ^

After a little debugging I realized, that what is happenning inside ClassDefinition.js that it downloads the html page from https://developers.google.com/maps/documentation/javascript/3.exp/reference and tries to parse it and fails.

This is most probable due to the fact that google changed the structure of that homepage.
Basing the build on an outside html source was never a good way to be reliable.

@jamesmosier
Copy link

Did you find a way to fix this (even just temporarily) @gergely-ujvari ?

@thzinc
Copy link

thzinc commented Dec 18, 2018

I'm running into this as well. It appears that the Google Maps API docs changed formatting. Now details of classes are in their own pages, so ClassDefinition.js needs to be updated. I'm working through this issue, so I may be able to produce a PR shortly.

@JustFly1984
Copy link

JustFly1984 commented Dec 18, 2018

@thzinc look at our new project, which supports async react, etc. https://github.com/justfly1984/react-google-maps-api
We are currently working on docs, etc. some of components is not done yet, but in general it is complete rewrite. And it does builds, and tree-shakable.

@thzinc
Copy link

thzinc commented Dec 19, 2018

I'm working on a fix for this in a fork. I'll PR upstream when I've passed a round of reviews by my engineering team. syncromatics#1

@JustFly1984 I'll take a look at your project, but I'm not quite ready to make a wholesale change to a new library. I have a significant codebase that is built around this package.

@JustFly1984
Copy link

@thzinc welcome! Anyway You need to think about new React 16.7 support, when react 16.7 will be out of beta. Current version does not support async react. You can help us out by joining our project as maintainer if you are interested.

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

Successfully merging a pull request may close this issue.

4 participants