Hi guys, i have the following configuration, a turborepo project using pnpm and some sveltekit apps, I have a few workspace packages and the all have the same configuration
{
"name": "@project/package",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"types": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
When I import from any of the packages it works as expected, there is no tsconfig.json because it's an internal package and gets packaged with the app, there is one package with the same configuration that I get this error
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/isaac/Desktop/projects/project/packages/formatters/index.ts
at new NodeError (node:internal/errors:387:5)
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:75:11)
at defaultGetFormat (node:internal/modules/esm/get_format:117:38)
at defaultLoad (node:internal/modules/esm/load:81:20)
at nextLoad (node:internal/modules/esm/loader:163:28)
at ESMLoader.load (node:internal/modules/esm/loader:601:26)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22)
at new ModuleJob (node:internal/modules/esm/module_job:63:26)
at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:476:17)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:434:34)
It only happens for this one package and it happens on every import (so I know I didn't somehow mess up the import) I couldn't find any differences in the packages, it has the same exact structure and since there are no config files I can't think of why it would fail only on this one
It's even weirder because it works on client side navigation only throws an error when visiting a page that uses this package on first load, if I click a link to those pages it loads and the package works