11 Aug 2022
For example, this is my regular expression :
^\d{4}\/(0?[1-9]|1[012])\/(0?[1-9]|[12][0-9]|3[01])$
It used to check if string is in YYYY-MM-DD form.
I used code as below at first, and found that regexp.test
always return false, even thouth it should return true.
const regexp = new RegExp('^\d{4}\/(0?[1-9]|1[012])\/(0?[1-9]|[12][0-9]|3[01])$')
console.log(regexp.test(date))
The solution is :
const regexp = new RegExp(/^\d{4}\/(0?[1-9]|1[012])\/(0?[1-9]|[12][0-9]|3[01])$/)
return(regexp.test(date))
To replace single quotations(‘) to slash(/) !
Check this website to get more information.
11 Aug 2022
if code setting favicon.ico in _document.tsx not work.
Try to replace your favicon.ico file to public
folder, then replacing original code to below :
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
11 Aug 2022
solution : Set title in pages/_app.js
<Head>
<title>Name</title>
</Head>
11 Aug 2022
If you encountering the problem as tile or Module not found: Error: Can't resolve 'date-fns/addDays'
or Module not found: Can't resolve '@date-io/date-fns'
…
Try to install date-fns package in version 2.28.0
21 Jul 2022
if you encounter error like this :
Uncaught (in promise) Error: Failed to resolve did:3:kjzl6cwe1jw147zqv5dtc1ftpxhxoo0tsabl7271zemu8hkjukmcey2ja2fhlu4?version-id=0#dMW2faveLVp6D2H: invalidDid, TypeError: Network request failed
at DID.resolve (did.js?f452:230:1)
at async DID.verifyJWS (did.js?f452:142:1)
at async DID.authenticate (did.js?f452:86:23)
and your code maybe look like :
const ceramic = new CeramicClient('')
const did = new DID({
// Get the DID provider from the 3ID Connect instance
provider: threeID.getDidProvider(),
resolver: {
...get3IDResolver(ceramic),
...getKeyResolver(),
},
})
Try to change
const ceramic = new CeramicClient()
to
const ceramic = new CeramicClient('https://ceramic-clay.3boxlabs.com')