2 Campaign Creation Errors
First issue is regarding the date format:
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: 2020-6-15, _f: undefined, _strict: undefined, _locale: [object Object]
fix is simple, just need to prefix the single digit months (1 - 9) with a 0
in views/create.html
.
<option value="1">1 - January</option>
<option value="01">1 - January</option>
Second issue is regarding the directory structure:
[Error: ENOENT: no such file or directory, open './static/campaigns/1/en/proposal.md'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './static/campaigns/1/en/proposal.md'
}
[Error: ENOENT: no such file or directory, open './static/campaigns/1/zh/proposal.md'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './static/campaigns/1/zh/proposal.md'
}
[Error: ENOENT: no such file or directory, open './static/campaigns/1/es/proposal.md'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './static/campaigns/1/es/proposal.md'
}
[Error: ENOENT: no such file or directory, open './static/campaigns/1/ja/abstract.md'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './static/campaigns/1/ja/abstract.md'
}
[Error: ENOENT: no such file or directory, open './static/campaigns/1/es/abstract.md'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './static/campaigns/1/es/abstract.md'
}
[Error: ENOENT: no such file or directory, open './static/campaigns/1/ja/proposal.md'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './static/campaigns/1/ja/proposal.md'
}
[Error: ENOENT: no such file or directory, open './static/campaigns/1/zh/abstract.md'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './static/campaigns/1/zh/abstract.md'
}
[Error: ENOENT: no such file or directory, open './static/campaigns/1/en/abstract.md'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './static/campaigns/1/en/abstract.md'
}
here is the code that fixes this (lines 28-30 of routes/create.js
):
// Create folder
const dir = "./static/campaigns/1/" + languageCode;
fs.mkdirSync(dir, { recursive: true });
Edited by Bitcoin Please