Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug] npx @temporalio/create@latest ./your-app fails to run

Aperta
#419 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript, webpack
Ambito
backend

Direzione di ricerca

Riproduci il malfunzionamento eseguendo npx @temporalio/create@latest ./your-app, quindi npm run start.watch nel progetto generato. Inizia da src/worker.ts e src/workflows.ts, seguendo l’errore di dipendenza di Webpack segnalato. Il lavoro è completato quando l’app generata si avvia senza richiedere il workaround manuale npm i -D ajv.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
What are you really trying to do?

When following the instructions, npx @temporalio/create@latest ./your-app currently generates an app that won't run.

Describe the bug

Starting the dev server results in Error: Cannot find module 'ajv/dist/compile/codegen'.

Workaround fix is to npm i -D ajv

Full error log:

❯ npm run start.watch

> [email protected] start.watch
> nodemon src/worker.ts

[nodemon] 3.1.10
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src/**/*
[nodemon] watching extensions: ts
[nodemon] starting `ts-node src/worker.ts`
2025-05-12T02:12:03.507Z [INFO] Creating worker {
  sdkComponent: 'worker',
  taskQueue: 'hello-world',
  options: {
    namespace: 'default',
    identity: '[email protected]',
    useVersioning: false,
    buildId: undefined,
    shutdownGraceTime: 0,
    enableNonLocalActivities: true,
    maxConcurrentWorkflowTaskPolls: 10,
    maxConcurrentActivityTaskPolls: 10,
    stickyQueueScheduleToStartTimeout: '10s',
    maxHeartbeatThrottleInterval: '60s',
    defaultHeartbeatThrottleInterval: '30s',
    isolateExecutionTimeout: '5s',
    workflowThreadPoolSize: 1,
    maxCachedWorkflows: 2310,
    showStackTraceSources: false,
    debugMode: false,
    interceptors: { activity: [], workflowModules: [] },
    nonStickyToStickyPollRatio: 0.2,
    sinks: { __temporal_logger: [Object] },
    connection: NativeConnection {
      nativeClient: [External: 14315a3e0],
      referenceHolders: Set(0) {}
    },
    taskQueue: 'hello-world',
    workflowsPath: '/Users/blitz/github/jlengstorf/temporal-learning/src/workflows.ts',
    activities: Map(1) { 'greet' => [AsyncFunction: greet] },
    tuner: {
      workflowTaskSlotSupplier: [Object],
      activityTaskSlotSupplier: [Object],
      localActivityTaskSlotSupplier: [Object]
    },
    reuseV8Context: true,
    shutdownGraceTimeMs: 0,
    shutdownForceTimeMs: undefined,
    stickyQueueScheduleToStartTimeoutMs: 10000,
    isolateExecutionTimeoutMs: 5000,
    maxHeartbeatThrottleIntervalMs: 60000,
    defaultHeartbeatThrottleIntervalMs: 30000,
    loadedDataConverter: {
      payloadConverter: [DefaultPayloadConverter],
      failureConverter: [DefaultFailureConverter],
      payloadCodecs: []
    }
  }
}
2025-05-12T02:12:03.717Z [ERROR] asset workflow-bundle-ad2cf6a44ef5ba59b611.js 18.2 KiB [emitted] [immutable] (name: main)
runtime modules 937 bytes 4 modules
cacheable modules 818 bytes
  modules with errors 117 bytes [true errors]
    ./node_modules/@temporalio/workflow/lib/worker-interface.js 39 bytes [built] [code generated] [1 error]
    ./node_modules/@temporalio/workflow/lib/global-overrides.js 39 bytes [built] [code generated] [1 error]
    ./node_modules/@temporalio/workflow/lib/index.js 39 bytes [built] [code generated] [1 error]
  modules by path ./src/ 701 bytes
    ./src/workflows-autogenerated-entrypoint.cjs 451 bytes [built] [code generated]
    ./src/workflows.ts 250 bytes [built] [code generated]

ERROR in ./node_modules/@temporalio/workflow/lib/global-overrides.js
Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: Cannot find module 'ajv/dist/compile/codegen'
Require stack:
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/definitions/typeof.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/keywords/typeof.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/keywords/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/schema-utils/dist/validate.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/schema-utils/dist/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/NormalModule.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/NormalModuleFactory.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/Compiler.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/webpack.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/workflow/bundler.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/worker.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/debug-replayer/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/src/worker.ts
    at Function.<anonymous> (node:internal/modules/cjs/loader:1405:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)
    at Function._load (node:internal/modules/cjs/loader:1215:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1491:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/src/definitions/typeof.ts:2:1)
 @ ./src/workflows-autogenerated-entrypoint.cjs 5:28-83

ERROR in ./node_modules/@temporalio/workflow/lib/index.js
Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: Cannot find module 'ajv/dist/compile/codegen'
Require stack:
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/definitions/typeof.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/keywords/typeof.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/keywords/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/schema-utils/dist/validate.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/schema-utils/dist/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/NormalModule.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/NormalModuleFactory.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/Compiler.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/webpack.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/workflow/bundler.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/worker.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/debug-replayer/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/src/worker.ts
    at Function.<anonymous> (node:internal/modules/cjs/loader:1405:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)
    at Function._load (node:internal/modules/cjs/loader:1215:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1491:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/src/definitions/typeof.ts:2:1)
 @ ./src/workflows.ts 1:0-55 2:18-33
 @ ./src/workflows-autogenerated-entrypoint.cjs 9:9-112

ERROR in ./node_modules/@temporalio/workflow/lib/worker-interface.js
Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: Cannot find module 'ajv/dist/compile/codegen'
Require stack:
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/definitions/typeof.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/keywords/typeof.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/keywords/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/dist/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/schema-utils/dist/validate.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/schema-utils/dist/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/NormalModule.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/NormalModuleFactory.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/Compiler.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/webpack.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/workflow/bundler.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/worker.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/debug-replayer/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/lib/index.js
- /Users/blitz/github/jlengstorf/temporal-learning/src/worker.ts
    at Function.<anonymous> (node:internal/modules/cjs/loader:1405:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)
    at Function._load (node:internal/modules/cjs/loader:1215:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1491:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/ajv-keywords/src/definitions/typeof.ts:2:1)
 @ ./src/workflows-autogenerated-entrypoint.cjs 2:12-67

webpack 5.99.8 compiled with 3 errors in 87 ms { sdkComponent: 'worker', taskQueue: 'hello-world' }
Error: Webpack finished with errors, if you're unsure what went wrong, visit our troubleshooting page at https://docs.temporal.io/develop/typescript/debugging#webpack-errors
    at /Users/blitz/github/jlengstorf/temporal-learning/node_modules/@temporalio/worker/src/workflow/bundler.ts:273:17
    at finalCallback (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/Compiler.js:496:32)
    at /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/Compiler.js:574:17
    at /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/HookWebpackError.js:67:2
    at Hook.eval [as callAsync] (eval at create (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/tapable/lib/Hook.js:18:14)
    at Cache.storeBuildDependencies (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/Cache.js:128:37)
    at /Users/blitz/github/jlengstorf/temporal-learning/node_modules/webpack/lib/Compiler.js:570:19
    at Hook.eval [as callAsync] (eval at create (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/blitz/github/jlengstorf/temporal-learning/node_modules/tapable/lib/Hook.js:18:14)
[nodemon] app crashed - waiting for file changes before starting...
Minimal Reproduction

Create a new TypeScript project:

npx @temporalio/create@latest ./your-app

Then attempt to run it:

npm run start.watch

Errors will appear.

Environment/Versions
  • OS and processor: M1 Mac
  • Temporal Version: CLI 1.3.0 (Server 1.27.1, UI 2.36.0), @temporalio/worker@^1.11.6
  • Are you using Docker or Kubernetes or building Temporal from source? no
Additional context
Lingua principale
TypeScript
Stelle
469
Fork
150
Merge medio
2g 16h
PR unite (30g)
3

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di temporalio/samples-typescript

Tutte le issue di temporalio/samples-typescript

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.