Open SpeedyCoder opened 1 week ago
Looks like this is related to "baseUrl": ".",
in tsconfig.json
. Looks like it will resolve .json
whereas in webpack we it doesn't resolve json files.
Changing the .json
to .js
or .ts
reproduces the resolving with tsc
but not with webpack. Seems there's a bug in the webpack handling that doesn't like up as well
Link to the code that reproduces this issue
https://github.com/wontondon/hypertune-nextjs-turbo-error
To Reproduce
npm install
npm run devt
Current vs. Expected behavior
Current
When loading the root page in dev mode using Turbopack we get the following error.
This is caused by Turbopack loading the
hypertune.json
file from the root of the repository instead of thehypertune
module. I've confirmed this by inspecting the loaded module in thegenerated/hypertune.ts
immediately following the import statement. Removing or renaming the json file also fixes the issue.Expected
The correct module is loaded and the page loads without issues even with the json file present in the root of the repository. This is the case when using
next dev
without the turbo flag, what suggests Turbopack is causing the problem.Provide environment information
Which area(s) are affected? (Select all that apply)
Developer Experience, Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I've tried updating all the dependencies to the latest versions, but that didn't fix the issue.