Issue with a workload execution #44

Open
opened 2024-01-15 22:16:34 +01:00 by denissb · 2 comments
denissb commented 2024-01-15 22:16:34 +01:00 (Migrated from github.com)

Describe the bug

There is an issue when running workloads with auto-imports, see error:

✖ Creating load 0
TRPCClientError: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "id"
    ],
    "message": "Required"
  }
]
    at Function.from (file:///Users/denissb/.nvm/versions/node/v20.10.0/lib/node_modules/@morten-olsen/mini-loader-cli/node_modules/@trpc/client/dist/TRPCClientError-38f9a32a.mjs:27:20)
    at file:///Users/denissb/.nvm/versions/node/v20.10.0/lib/node_modules/@morten-olsen/mini-loader-cli/node_modules/@trpc/client/dist/httpBatchLink-d0f9eac9.mjs:189:60
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

To Reproduce

  1. Create sample workload based on the guide (say test2.ts):
import { http } from "@morten-olsen/mini-loader";
import fastify from "fastify";

const server = fastify();

// Handling all requests and returning the requested URL
server.all("*", async (req) => {
  return req.url;
});

// Listening on the path provided by mini loader
server.listen({
  path: http.getPath(),
});

  1. Run it with auto-imports (or without) mini-loader loads push -r -ai test2.ts

Expected behavior
Exception with above mentioned message.

**Describe the bug** There is an issue when running workloads with auto-imports, see error: ``` ✖ Creating load 0 TRPCClientError: [ { "code": "invalid_type", "expected": "string", "received": "undefined", "path": [ "id" ], "message": "Required" } ] at Function.from (file:///Users/denissb/.nvm/versions/node/v20.10.0/lib/node_modules/@morten-olsen/mini-loader-cli/node_modules/@trpc/client/dist/TRPCClientError-38f9a32a.mjs:27:20) at file:///Users/denissb/.nvm/versions/node/v20.10.0/lib/node_modules/@morten-olsen/mini-loader-cli/node_modules/@trpc/client/dist/httpBatchLink-d0f9eac9.mjs:189:60 at processTicksAndRejections (node:internal/process/task_queues:95:5) ``` **To Reproduce** 1. Create sample workload based on the guide (say test2.ts): ```ts import { http } from "@morten-olsen/mini-loader"; import fastify from "fastify"; const server = fastify(); // Handling all requests and returning the requested URL server.all("*", async (req) => { return req.url; }); // Listening on the path provided by mini loader server.listen({ path: http.getPath(), }); ``` 2. Run it with auto-imports (or without) `mini-loader loads push -r -ai test2.ts` **Expected behavior** Exception with above mentioned message.
denissb commented 2024-01-15 22:19:07 +01:00 (Migrated from github.com)

Got it, I needed to provide an identifier, so
mini-loader loads push -ai test2.ts -i second works fine.

Probably the guide should be updated.

Got it, I needed to provide an identifier, so `mini-loader loads push -ai test2.ts -i second` works fine. Probably the guide should be updated.
morten-olsen commented 2024-01-16 09:23:24 +01:00 (Migrated from github.com)

Ah, you are correct - disabled the auto id generation because it quickly became messy, but will re-enable it in #45, but apply a prefix to autogenerated ids

Also created #46 which should allow for easier management of prefixes, such as the auto-id/ prefix

Ah, you are correct - disabled the auto id generation because it quickly became messy, but will re-enable it in #45, but apply a prefix to autogenerated ids Also created #46 which should allow for easier management of prefixes, such as the auto-id/ prefix
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
experiments/mini-loader#44
No description provided.