I am working with the monorepo structure created after using create-next-turbo
.
I am struggling to figure out how to get Chrome and/or Firefox to find the relevant sourcemaps. I think I have found where sourcemaps are being output, which is .rootappswebnode_modulesnextdistpages
.
For some reason, Chrome/Firefox are unable to locate these sourcemaps automatically (I have verified the option to use sourcemaps are ‘ticked’ in settings).
I wonder if it’s a problem with my tsconfig.json
given that there are effectively 3 tsconfigs
at play. I know I need to clean this up, and will probably do that next!
root/apps/web/tsconfig.json
{
"extends": "@monorepo/typescript-config/nextjs.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@/components/*": ["./src/components/*"]
},
"strict": true,
"strictNullChecks": true,
"plugins": [
{
"name": "next"
}
],
"sourceMap": true
},
"include": ["src", "next.config.js", "next-env.d.ts", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
root/packages/typescript-config/nextjs.json
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Next.js",
"extends": "./base.json",
"compilerOptions": {
"plugins": [
{
"name": "next"
}
],
"allowJs": true,
"declaration": false,
"declarationMap": false,
"incremental": true,
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"resolveJsonModule": true
}
}
root/packages/typescript-config/base.json
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Default",
"compilerOptions": {
"composite": false,
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"allowImportingTsExtensions": true,
"inlineSources": false,
"isolatedModules": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"noUnusedLocals": false,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"strictNullChecks": true
},
"exclude": ["node_modules"]
}