I can’t seem to reproduce this locally so I thought I’d reach out here, perhaps for some help with locating the root of the problem.
I am working on a SvelteKit site hosted on Netlify – (eloquent-euclid-d54e46) – and have recently updated my dependencies. Updating Vite to 2.7.1 causes the site to break completely, returning:
{
"errorType": "Runtime.UserCodeSyntaxError",
"errorMessage": "SyntaxError: Unexpected token '.'",
"trace": [
"Runtime.UserCodeSyntaxError: SyntaxError: Unexpected token '.'",
" at _loadUserApp (/var/runtime/UserFunction.js:98:13)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
" at Object.<anonymous> (/var/runtime/index.js:43:30)",
" at Module._compile (internal/modules/cjs/loader.js:999:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
" at Module.load (internal/modules/cjs/loader.js:863:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
" at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)",
" at internal/main/run_main_module.js:17:47"
]
}
Previous posts with similar errors seem to indicate that this is generally an issue with Netlify’s version of NodeJs having trouble with the syntax used, but I’ve manually set the version to lts (16.13.1) and have no issue spinning up a dev instance locally with the same Node version. I’ve had a look at the generated code from a local build and there’s nothing that seems to be in error, but the above error doesn’t give me enough information to know where to look (or maybe I’m not reading the stack trace right).
Any ideas where I could look or what I could try to narrow down the issue?
Thanks!