Files
route-commerce/.audit/find_syntax_err.js
T
Nora 20c03acdaa
Deploy to route.crispygoat.com / deploy (push) Successful in 3m26s
revert: drop smartsheet backfill script from deploy
The script kept failing on deploy (ESM vs CJS issue, plus the
script file wasn't being shipped). User decided not to worry
about it. The 26 manual rows will remain in the sheet without
Entry IDs; the cron will retry them with a manual cleanup
of any duplicates if needed.
2026-07-03 17:35:44 -06:00

23 lines
873 B
JavaScript

// Find exact syntax error in eval content
const fs = require('fs');
const acorn = require('acorn');
const content = fs.readFileSync('/tmp/eval_content.js', 'utf8');
try {
acorn.parse(content, { ecmaVersion: 'latest', sourceType: 'script' });
console.log('OK - no syntax error');
} catch (e) {
console.log('Error:', e.message);
console.log('Position:', e.pos);
console.log('Line:', e.loc && e.loc.line);
console.log('Column:', e.loc && e.loc.column);
if (e.pos != null) {
const start = Math.max(0, e.pos - 100);
const end = Math.min(content.length, e.pos + 100);
console.log('\nContext (100 chars before/after):');
console.log('BEFORE:', JSON.stringify(content.slice(start, e.pos)));
console.log('ERROR :', JSON.stringify(content.slice(e.pos, e.pos + 5)));
console.log('AFTER :', JSON.stringify(content.slice(e.pos + 5, end)));
}
}