formkit: Cannot find module '@formkit/themes/tailwindcss/genesis'

Reproduction

https://formkit.com/getting-started/installation

Describe the bug

The genesis theme is not found import genesis from '@formkit/themes/tailwindcss/genesis', per instructions for importing the Tailwind version of genesis theme https://formkit.com/getting-started/installation

Environment

• OS: [e.g. iOS] • Browser [e.g. chrome, safari] • Version [e.g. 22]

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 31 (13 by maintainers)

Most upvoted comments

image Despite the TypeScript warning, worked just fine. Thanks for the great job.

Does this error persist if you restart VSCode’s typescript server?

Everything working fine.

The correct import is without dist like so: import genesis from '@formkit/themes/tailwindcss/genesis'; but it looks like some module resolutions do not correctly get this, so in those cases you may need to change the module resolution of your application.

With that in mind, we are recommending people to create a themes.js file and copy the contents of the ts export there instead https://formkit.com/guides/create-a-tailwind-theme#a-complete-tailwind-theme-recreating-genesis-css

@sr-skillmore Spoke to the team, and it seems like the installation instructions are wrong. I will look into updating those. The import path should be: import genesis from '@formkit/themes/dist/tailwindcss/genesis'

Thank you for the response, but adding the dist path also does not work for me. Please see the recreation on stackblitz here: https://stackblitz.com/edit/nuxt-starter-xv4bnr?file=package.json,nuxt.config.ts,formkit.config.ts,app.vue,tailwind.config.js

The error in the image is what shows up for me.

Screenshot 2023-06-23 at 10 13 34 AM

Below is a snapshot of my node_modules folder:

Screenshot 2023-06-23 at 10 28 24 AM

works like a charm, thank you so much @andrew-boyd 🙏🏼

This has been published under the @next tag

@aerophobic @michelveloso can you try 1.0.0-beta.15-3995886 which can be installed with the @dev tag? Should be working. I’ll publish it under the @next tag shortly.

I will take a look thank you.

Same error in Nuxt 3

image

am still having the issue with nuxt this is the error

[vite] Internal server error: Missing “./dist/tailwindcss/genesis” export in “@formkit/themes” package

Looks like the genesis export alias didn’t make it to the package.json for the @formkit/themes package. Changing the import to include the /dist/ directory in the path will work for the time being.

so this: import genesis from '@formkit/themes/tailwindcss/genesis'

becomes: import genesis from '@formkit/themes/dist/tailwindcss/genesis'