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

if(!metaData.file_url.includes('https://')) { #20

Closed
craigbersiks opened this issue Jan 4, 2022 · 8 comments
Closed

if(!metaData.file_url.includes('https://')) { #20

craigbersiks opened this issue Jan 4, 2022 · 8 comments

Comments

@craigbersiks
Copy link

Hi,

Thank you for the update! looking great.

I seem to be getting this error now:

if(!metaData.file_url.includes('https://')) {........... TypeError: Cannot read properties of undefined (reading 'includes')

I am not sure what I am doing wrong.

@ryuncoding
Copy link

Im having same problem

@codeSTACKr
Copy link
Owner

seems like some of your metadata doesn't have a file_url? Can you provide an example of a json file from the build folder?

@ryuncoding
Copy link

Yes its about that i have already checked. Thanks. I built my images and json files with old version of config.js. I updated my config.js with your latest version and I rebuild my NFTs and it fixed. Thanks a lot.

@craigbersiks
Copy link
Author

{
"name": "MysteryOrb #1",
"description": "Orb Collection",
"image": "ipfs://NewUriToReplace/1.png",
"dna": "206e32739e05ba470d7d1a3897c44869d1a365ee",
"edition": 1,
"date": 1641313918556,
"attributes": [
{
"trait_type": "Background",
"value": "Marble Lab"
},
{
"trait_type": "Cloud",
"value": "Cloud"
},
{
"trait_type": "Shadow",
"value": "Here's Reddy"
},
{
"trait_type": "Orb",
"value": "Yellow Blue Spotty"
}
],
"compiler": "AfricanMystery"
}

@craigbersiks
Copy link
Author

Fixed it, Thank you

@niveknonrev
Copy link

niveknonrev commented Jan 4, 2022

I'm having the same issue TypeError: Cannot read properties of undefined (reading 'includes') - checked my config.js and it matches, and my JSON files have the File_url - here is an example "File_url": "ipfs://NewUriToReplace/1.png",

any other suggestions on what to look at?

it's odd that is says reading a property, but shouldn't it be a method? just an observation. when I use intellisense it doesn't show "includes" as an option after File_url.

@engmsaleh
Copy link

I have faced the same issue and found that Hashlibs now uses image instead of file_url in a function called addMetaData in main.js

@Denni007
Copy link

Denni007 commented Feb 1, 2022

Hi All

I solved this error, which I was getting when applying "includes" to a "!metaData.file_url.includes('https://'" value, by appending ".toString();"
!metaData.file_url.toString().includes("https://")

The .includes() API is part of the String and Array data type.

So what the error is trying to tell you is that the value for variable value, e.g. an integer or json object, does not have the property .includes.

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

6 participants