wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
12.7k stars 1.13k forks source link

Can we have better error messages for TS5097: non '.ts' extension used in a query or operation ext import #2087

Open Martinsos opened 3 weeks ago

Martinsos commented 3 weeks ago

This is the message I got:

image

This was caused by me specifying .ts extension in operation ext import:

action createFile {
  fn: import { createFile } from "@src/file-upload/operations.ts",
  entities: [User, File]
}

Once I removed that .ts, error went away.

But it would be hard for others to figure out this was the cause, the ext import in main.wasp.

Martinsos commented 2 weeks ago

@sodic suggest forbidding any extension in ext imports or somehow processing them by us so we allow all of them.

Martinsos commented 2 weeks ago

Or maybe we turn on this compiler flag, if it has no bad effects.

Martinsos commented 2 weeks ago

Sending this back to triage, this is quite an annoying error.