turbo icon indicating copy to clipboard operation
turbo copied to clipboard

[turbopack]

Open mnengwa opened this issue 2 years ago • 1 comments

What version of Turbopack are you using?

alpha

What package manager are you using / does the bug impact?

npm

What operating system are you using?

Windows

Describe the Bug

Hi, I had set up my aliases which work fine when using the default bundler (Webpack) in Next 13. However, it all breaks when I use the turbo flag to start the dev server.

image

image

Expected Behavior

When using the npm run dev --turbo on a Next 13 project, it should recognize the path aliases as defined in the jsconfig.json file.

To Reproduce

  1. Install Next 13 and enable turbo by changing npm run dev to npm run dev --turbo
  2. Create a directory named lib and inside it create two more assets and components
  3. Create a jsconfig.js file with the following content
{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            "@/assets/*": [
                "lib/assets/*"
            ],
            "@/components/*": [
                "lib/components/*"
            ]
        }
    }
}
  1. Start the dev server with npm run dev
  2. Try the path alias in an import

Reproduction Repo

No response

mnengwa avatar Nov 19 '22 15:11 mnengwa

it only happens when using --turbo

"scripts": {
  "dev": "next dev --turbo",  🔴
  "dev": "next dev",  🟢
}
🔴 yarn dev --turbo
🟢 yarn turbo dev

Xariwey avatar Nov 19 '22 23:11 Xariwey

jsconfig.json right now has not been supported. I found it a feature request as #2357 mentioned.

Fnll avatar Dec 07 '22 18:12 Fnll

Same issue for me using the following config: { "compilerOptions": { "baseUrl": "src" } }

hlodver avatar Jan 13 '23 10:01 hlodver

jsconfig.json support added in Next.js 13.2

padmaia avatar Mar 22 '23 20:03 padmaia