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

Headtags.script Not Defined #1

Open
FaeezBorman opened this issue Feb 1, 2018 · 6 comments
Open

Headtags.script Not Defined #1

FaeezBorman opened this issue Feb 1, 2018 · 6 comments

Comments

@FaeezBorman
Copy link

Hi Guys

Still getting my feet wet with vulcan, today I tried to use this package

TypeError: Cannot read property 'script' of undefined
at meteorInstall.node_modules.meteor.vulcan:places.lib.modules.headtags.js
(packages/vulcan:places/lib/modules/headtags.js:7:7)

I am on vulcan/core 1.7.0, I have not used headtags anywhere yet

wondering if i need to include somewhere in the server start up

Thanks in advise

@SachaG
Copy link
Contributor

SachaG commented Feb 2, 2018

Can you try updating to the latest Vulcan (1.8.7 currently) first?

@FaeezBorman
Copy link
Author

Sure, let me try that

@FaeezBorman
Copy link
Author

FaeezBorman commented Feb 8, 2018

@SachaG I have tried with Vulcan 1.8.9 latest

I am having a similar problem

Initially with PlaceControl.jsx:71:25

PlaceControl.propTypes = {
name: React.PropTypes.string,
value: React.PropTypes.any,
label: React.PropTypes.string
};

TypeError: Cannot read property 'string' of undefined

I changed my local version to import PropTypes directly, React no longer ships with it

import PropTypes from 'prop-types'

PlaceControl.propTypes = {
name: PropTypes.string,
value: PropTypes.any,
label: PropTypes.string
};

Now I get the same error as before on went this executes

Headtags.script.push({
type: 'text/javascript',
src: https://maps.googleapis.com/maps/api/js?key=${googlemaps.apiKey}&libraries=places
});

TypeError: Cannot read property 'script' of undefined

Let me know what other details you require.

I will say that I have been working on this project of mine on-off for some time. I may be missing some crucial changes required since multiple upgrades to vulcan core have taken place throughout that time

@FaeezBorman
Copy link
Author

I found something

Looks like a typo, the import should be

import { HeadTags, getSetting } from 'meteor/vulcan:core';

however, script is undefined

on my local copy i just added

HeadTags.script = []

@calinn
Copy link

calinn commented Jun 9, 2018

You must change 'HeadTag' name. 'Head' instead of 'HeadTag'
import { Head } from 'meteor/vulcan:core';
Head.script.push();

https://github.com/VulcanJS/Vulcan/blob/0c06dc9b55e6bb456124f38f881aebad917c8025/packages/vulcan-core/lib/modules/components/HeadTags.jsx

lc3t35 pushed a commit to lc3t35/vulcan-places that referenced this issue Jun 15, 2018
SachaG added a commit that referenced this issue Jun 16, 2018
@lc3t35
Copy link

lc3t35 commented Jun 18, 2018

you have also to migrate

<PlacesAutocomplete inputProps={inputProps} onSelect={this.onSelect} />

with last version of https://github.com/kenny-hibino/react-places-autocomplete/wiki/Migration-Guide-(From-v6.x-to-v7.x)

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

4 participants