Next.js Discord

Discord Forum

turbopack sourcemap url encoded

Unanswered
Paper wasp posted this in #help-forum
Open in Discord
Paper waspOP
I'm using next 16 (16.0.3) and turbopack through docker and docker compose in dev mode.

I've been using next since version 13 and never had any issue making debugger work through docker with webpack, using sourcemapoverrides localRoot & remoteRoot.

however now that next uses turbopack, I cannot find a suitable sourcemapoverrides, because turbopack url encodes the file path, which vscode & cursor does not seem to be able to treat.

"sourceMapPathOverrides": {
        // Base path mappings
        "/usr/app/frontend/*": "${workspaceFolder}/frontend/*",
        "file:///usr/app/frontend/*": "${workspaceFolder}/frontend/*",

        // Turbopack protocol mappings
        "turbopack:///_N_E/*": "${workspaceFolder}/frontend/*",
        "turbopack:///./*": "${workspaceFolder}/frontend/*",
        "turbopack:///*": "${workspaceFolder}/frontend/*",

        // URL-encoded route segments (Turbopack encodes [segment] as %5Bsegment%5D)
        "file:///usr/app/frontend/app/%5Blocale%5D/*": "${workspaceFolder}/frontend/app/[locale]/*
      },


this is what I'm forced to do, but I cannot do this for everything that has brackets ...

is there any way to disable the encoding ?

If I disable my hardcodedsource map path override I get

✅ This breakpoint was initially set in:

/home/xxx/workspace/my-project/frontend/app/[locale]/page.tsx line 17 column 3

❓ We couldn't find a corresponding source location, but found some other files with the same name:

/home/xxx/workspace/my-project/frontend/app/%5Blocale%5D/page.tsx
If this is the same file, you may need to adjust your build tool to correct the paths.

1 Reply

Paper waspOP