16 Aug 2022
I encounter error like picture when click button which used to connect wallet extension in AWS ubuntu environment :
This error appears if open web by using http not https. Establish SSL connection and become https, problem solved !
13 Aug 2022
Run slither command then encounter error like :
Error: Source "@openzeppelin/contracts/access/Ownable.sol" not found: File not found. Searched the following locations: "".
Solution : add some flag behind original command
ex.
slither contracts/YOUR_CONTRACT.sol --solc-remaps @openzeppelin/=$(pwd)/node_modules/@openzeppelin/
13 Aug 2022
Error: Hydration failed because the initial UI does not match what was rendered on the server.
I encounter this problem after modify my folder location, and I solve this by cleaning the browser cache & to delete .next folder .
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" />