You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module
"file:///app/dist/training-agent/fixtures/verification-walkthrough/northwind-brand.json"
needs an import attribute of "type: json"
Introduced by #4675 — added four bare JSON imports in server/src/training-agent/fixtures/verification-walkthrough/index.ts. Node 22 ESM rejects JSON imports that don't carry with { type: 'json' }. The compiled dist/index.js threw on boot, fly-runner restarted, both web machines hit max restart count (10), no requests could land on a healthy backend.
Why we didn't just add with { type: 'json' }
That was the obvious first attempt. TypeScript rejected it:
TS2823: Import attributes are only supported when the '--module' option is set
to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'.
server/tsconfig.json is on module: "ES2022". Bumping the module setting fixes the typecheck but has repo-wide blast radius and didn't feel right for a hotfix on a crash loop.
What this PR does
Inlines the four fixture documents as as const object literals in index.ts and deletes the standalone .json files. No filesystem reads at runtime, no import attributes needed, no tsconfig change.
Alternatives considered
Bump tsconfig module to ESNext/NodeNext + add with { type: 'json' } — keeps the .json files but changes module emission for the whole server build. Heavier than warranted for a hotfix.
Convert each .json → sibling .ts (northwind-brand.ts etc., each export default { ... } as const;) — preserves the per-fixture file layout from feat(training-agent): seller-verification walkthrough fixtures #4675 without needing import attributes. Functionally equivalent to the inline approach; trade-off is N files vs. one consolidated file.
Happy to split (2) back out if reviewers prefer keeping the per-fixture layout — let me know.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.