FractalF
Convex Community2y ago
10 replies
Fractal

Convex dev server chokes on Emacs backup files

By default, my text editor (Emacs) saves backup files in the same directory by adding a # to the beginning and the end of the file name. So for instance a file called functions.ts will generate a backup file called #functions.ts# (which then gets removed automatically when saving the original file).
The problem is that npx convex dev chokes on those files, it crashes with the following error message:

⠙ Preparing Convex functions...
Unexpected Error: SyntaxError: Private identifiers are not allowed outside class bodies. (13:20)
  11 |   
  12 |   import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server";
> 13 |   import type * as #functions from "../#functions.js";
     |                    ^
  14 | import type * as functions from "../functions.js";
  15 |


It actually crashes, so my functions are not kept synchronized anymore and I have to restart npx convex dev for my functions to synchronize again, which is pretty annoying.

Sure I could configure Emacs to save the backup files somewhere else or with a different name, but it would be nice if it worked out of the box. After all the extension is .ts# so it should not even be considered as a Typescript file by Convex?
Was this page helpful?