Closed macjabeth closed 12 months ago
Thanks for reporting the issue. While your code runs when using next.js CLI tools, it's not valid for running code with node.js, which is how Quokka works. Because your TypeScript configuration has moduleResolution: "bundler"
, this means ES module code will be emitted, which is not going to work in node.js without having type: "module"
in your package.json
. To allow Quokka to work in these cases we've added logic to force moduleResolution: "Node16"
when type: "module"
has not been specified. This logic is available in Quokka for VS Code version 1.0.599
.
Issue description or question
I'm getting the following error in the console when trying to run Quokka on a Next.js starter TypeScript file.
Sample repository link
I was following the Next.js getting started guide here: https://nextjs.org/learn/dashboard-app/getting-started
The command to create the same setup would be
The failing file was
app/lib/utils.ts
.Quokka.js Console Output
Code editor & OS name/version
Visual Studio Code v1.84.2 Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e Date: 2023-11-09T10:52:57.054Z Electron: 25.9.2 ElectronBuildId: 24603566 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Darwin arm64 23.1.0