RegExp.test returns false, even though it should return true

For example, this is my regular expression :
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])$')

The solution is :

  const regexp = new RegExp(/^\d{4}\/(0?[1-9]|1[012])\/(0?[1-9]|[12][0-9]|3[01])$/)

To replace single quotations(‘) to slash(/) ! Check this website to get more information.

Next.js favison.icon not work

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" />

Warning - title should not be used in _document.js's Head.

solution : Set title in pages/_app.js


Error - Cannot find module 'date-fns/formatISO

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

Ceramic Network request failed

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: {

Try to change

const ceramic = new CeramicClient()


const ceramic = new CeramicClient('')