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

Unable to generate local formkit theme using formkit.theme.config.ts #1534

Open
piscis opened this issue Oct 22, 2024 · 0 comments
Open

Unable to generate local formkit theme using formkit.theme.config.ts #1534

piscis opened this issue Oct 22, 2024 · 0 comments
Labels
🐛 bug-report Bug is reported, but not verified by team ⛑ Needs triage The issue has not yet been examined by the FormKit team.

Comments

@piscis
Copy link

piscis commented Oct 22, 2024

Reproduction

https://cli-related.and.does.not.apply.example.com

Describe the bug

There seems to be an issue with the formkit CLI when creating a theme file from a formkit theme project.

formkit.theme.config.ts

import theTheme from '@myTheme/form-wizard-theme'
export default theTheme

if I use npx [email protected] theme --theme=./formkit.theme.config.ts or npx formkit@latest theme --theme=./formkit.theme.config.ts I receive the following error:

Output:

❯ npx [email protected] theme --theme=./formkit.theme.config.ts
npm WARN ignoring workspace config at /Users/xxx/app/.npmrc 
Locating ./formkit.theme.config.ts...
Found local theme file
node:internal/modules/esm/get_format:176
  throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);
        ^

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/xxx/app/formkit.theme.config.ts
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:176:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:219:36)
    at defaultLoad (node:internal/modules/esm/load:143:22)
    at async ModuleLoader.load (node:internal/modules/esm/loader:555:7)
    at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:434:45)
    at async link (node:internal/modules/esm/module_job:87:21) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}

Node.js v20.18.0

However if I try to generate the theme with npx [email protected] theme --theme=./formkit.theme.config.ts it works.

Output:

❯ npx [email protected] theme --theme=./formkit.theme.config.ts
npm WARN ignoring workspace config at /Users/xxx/app/.npmrc 

Locating ./formkit.theme.config.ts...
Found local theme file
Loaded theme: BlaBla
Theme file written to formkit.theme.ts

Environment

• OS: MacOS 15.0.1
• CLI
• Version Node Version 20.18.0

@piscis piscis added ⛑ Needs triage The issue has not yet been examined by the FormKit team. 🐛 bug-report Bug is reported, but not verified by team labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug-report Bug is reported, but not verified by team ⛑ Needs triage The issue has not yet been examined by the FormKit team.
Projects
None yet
Development

No branches or pull requests

1 participant