yoni-rapoport / fresh-remult-todo

4 stars 3 forks source link

Appears to be broken on latest deno #7

Open VMannello opened 11 months ago

VMannello commented 11 months ago

Example appears to be broken with latest deno and remult.

An error occurred during route handling or page rendering. Error: Item is not a known entity, did you forget to set @Entity() or did you forget to add the '@' before the call to Entity?
    at E (https://esm.sh/v132/remult@0.20.0/denonext/remult-fresh.js:2:16060)
...
LegitPanda commented 3 months ago

Running into (probably) the same issue:

[remult] /api/tasks
X [ERROR] Transforming JavaScript decorators to the configured target environment ("chrome99", "firefox99", "safari15") is not supported yet

    model/task.ts:3:0:
      3 │ @Entity("tasks", {
        ╵ ^

I think it's because fresh defaults to targeting es2022 in esbuild but even if I change it to esnext none of the JS works because it's unable to serve node:process to the web (at least that's one of the issues I'm stuck on)

I haven't found a way to just enable experimental headers through fresh either even though I have it in my deno.json

  "compilerOptions": {
    "experimentalDecorators": true
  },

Tried also without decorators:

export class Task {
  id!: string;
  title = "";
  completed = false;
}

describeEntity(
  Task,
  "tasks",
  {
    id: Fields.uuid(),
    title: Fields.string(),
    completed: Fields.boolean(),
  },
  { allowApiCrud: true },
);

Still run into the node:process error Loading module from “http://localhost:8000/_frsh/js/31ce13fd8772824cc065e4f9876c4f6bca7ce1bc/node:process” was blocked because of a disallowed MIME type (“”).