mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
e2262334f8
Improve deobfuscation of 'imported module identifier' and attempt to deobfuscate error messages logged by the server.
Before
```
⨯ TypeError: (0 , __TURBOPACK__imported__module__$5b$project$5d2f$examples$2f$with$2d$turbopack$2f$app$2f$foo$2e$ts__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__.foo) is not a function
at Page (app/page.tsx:5:6)
3 | export default function Page() {
4 | /** @ts-ignore */
> 5 | foo();
| ^
6 | return <h1>Hello, Next.js!</h1>;
7 | }
8 | {
```
after
```
⨯ TypeError: {imported module ./examples/with-turbopack/app/foo.ts}.foo is not a function
at Page (app/page.tsx:5:6)
3 | export default function Page() {
4 | /** @ts-ignore */
> 5 | foo();
| ^
6 | return <h1>Hello, Next.js!</h1>;
7 | }
8 | {
```
Similarly in devtools
before:

after

This is definitely an improvement but i am not sure i put the deobfuscation logic in the best place for the console case. Happy for feedback
33 lines
713 B
JSON
33 lines
713 B
JSON
{
|
|
"compilerOptions": {
|
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
"allowJs": true,
|
|
"skipLibCheck": true,
|
|
"strict": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"noEmit": true,
|
|
"incremental": true,
|
|
"esModuleInterop": true,
|
|
"module": "esnext",
|
|
"moduleResolution": "node",
|
|
"resolveJsonModule": true,
|
|
"isolatedModules": true,
|
|
"jsx": "react-jsx",
|
|
"plugins": [
|
|
{
|
|
"name": "next"
|
|
}
|
|
],
|
|
"strictNullChecks": true,
|
|
"target": "ES2017"
|
|
},
|
|
"include": [
|
|
"next-env.d.ts",
|
|
".next/types/**/*.ts",
|
|
"**/*.ts",
|
|
"**/*.tsx",
|
|
".next/dev/types/**/*.ts"
|
|
],
|
|
"exclude": ["node_modules", "**/*.test.ts", "**/*.test.tsx"]
|
|
}
|