Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading ts file via subpath export in app.config.ts in >0.3.4 doesn't work #259

Open
Brendonovich opened this issue Mar 18, 2024 · 0 comments

Comments

@Brendonovich
Copy link
Contributor

In v0.3.5 and greater, using a subpath export from a monorepo package that points to a .ts file fails with the following error:

node:internal/modules/esm/get_format:160
  throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);
        ^

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/brendonovich/github.com/mattrax/mattrax/apps/forge/app.config.timestamp_1710758212592.ts
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
    at defaultLoad (node:internal/modules/esm/load:143:22)
    at async ModuleLoader.load (node:internal/modules/esm/loader:409:7)
    at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:45)
    at async link (node:internal/modules/esm/module_job:76:21) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}

I expect this is because 0.3.5 changed the loading of app.config.ts from using a dynamic import() to dedicated bundling with esbuild.

Here's a repro of the error occurring. Downgrading vinxi to =0.3.4 and running pnpm install results in the config loading properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant