What this snippet does
TypeScript paths are purely a compile-time concept; at runtime in Node.js, the alias '@/' will fail unless a bundler or ts-node registration resolves it.
Expected output
Runtime Error: Cannot find module '@/models'
Why practise typing this
Typing advanced modules code builds muscle memory for the symbols and indentation TypeScript uses most, which prose-based typing tests never cover. DevType measures your words per minute and accuracy on this snippet and tracks the individual characters you mistype, so later lessons can target them.
More TypeScript practice
- Typing a dynamic importAdvanced Modules · advanced
- Conditionally loading an analytics moduleAdvanced Modules · advanced
- Accessing non-existent exports from a dynamic importAdvanced Modules · advanced
- Using import type for interfacesAdvanced Modules · advanced
- Mixing type and value imports inlineAdvanced Modules · advanced
- Attempting to use a type-only import as a valueAdvanced Modules · advanced