MCPcopy Create free account
hub / github.com/TanStack/router / codeFrameError

Function codeFrameError

packages/start-plugin-core/src/start-compiler/utils.ts:5–26  ·  view source on GitHub ↗
(
  code: string,
  loc: {
    start: { line: number; column: number }
    end: { line: number; column: number }
  },
  message: string,
)

Source from the content-addressed store, hash-verified

3import type babel from '@babel/core'
4
5export function codeFrameError(
6 code: string,
7 loc: {
8 start: { line: number; column: number }
9 end: { line: number; column: number }
10 },
11 message: string,
12) {
13 const frame = codeFrameColumns(
14 code,
15 {
16 start: loc.start,
17 end: loc.end,
18 },
19 {
20 highlightCode: true,
21 message,
22 },
23 )
24
25 return new Error(frame)
26}
27
28export function cleanId(id: string): string {
29 // Remove null byte prefix used by Vite/Rollup for virtual modules

Callers 2

throwBoundaryErrorFunction · 0.90
handleCreateServerFnFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected