Troubleshooting
Build Errors
Diagnose and fix JavaScript and CSS build failures.
Symptom
A deployment fails and the Problems panel or deploy toast shows a build error. The error message includes a file name, line number, column number, and a code snippet showing the failure location.
Example:
Build error in src/main.ts at line 5, column 12
4 | const items = [];
> 5 | items.push(undefined.property);
^
6 |
Cannot read property 'property' of undefinedLikely Causes
- Syntax error in JavaScript or TypeScript: Missing brackets, unclosed strings, invalid expressions.
- Syntax error in CSS or SCSS: Malformed selectors, missing semicolons, unclosed blocks.
- Unresolved relative import: An
importorrequirestatement references a file that does not exist in the project. - TypeScript-specific errors: esbuild strips types but does not type-check. Some invalid TypeScript constructs (e.g.,
import typeused as a value) still cause build failures. - SCSS compilation failure: Dart Sass rejects the SCSS before esbuild processes the CSS output. See SCSS Compilation Errors for SCSS-specific issues.
Checks
- Open the Problems panel (
Cmd+Shift+M) and look for the error. Click the error to jump to the file and line. - Read the error message. esbuild error messages are direct: they name the file, line, column, and describe what the parser expected vs what it found.
- Check whether the error is in a file you recently edited. If you added or renamed a file, verify that all
importpaths referencing it are updated. - If the error references an external package (e.g.,
gsap,lodash), check Bare Import Warnings. External packages are not bundled by Odyn.
Fixes
Syntax errors
Fix the code at the indicated line and column. Common cases:
- Missing closing bracket:
},), or]. - Unterminated string literal: add the closing quote.
- Unexpected token after a recent paste or refactor: check for stray characters.
Unresolved imports
- Verify the imported file exists in the file tree.
- Check the relative path:
./utilsresolves from the importing file's directory. - Check the file extension: Odyn resolves
.js,.ts,.jsx,.tsx,.mjs,.cjsautomatically. If the file uses a non-standard extension, include it explicitly.
SCSS errors
Build errors are evaluated at deploy time. A fix in the editor does not clear the error until the next deploy attempt — save (Cmd+S) and redeploy after fixing.
What to Capture for Escalation
If the error persists after the above checks, gather the following before reaching out for support.
- The full error message from the Problems panel (file, line, column, message).
- The content of the file at the indicated line (copy 5 lines above and below).
- The deployment mode (bundled, per-file, or folder bundle).
- Whether the error reproduces on every deploy or intermittently.
- Browser console output if the error occurs client-side after deploy.