module-builder
module-builder copied to clipboard
Importing directly from module entry-points is not allowed.
error: “Importing directly from module entry-points is not allowed” when importing from @nuxt/ui
Description:
I am encountering an intermittent error when importing types from @nuxt/ui. Sometimes the import works as expected, but other times it fails with the following message:
Importing directly from module entry-points is not allowed. [importing `@nuxt/ui` from]
Example code:
import { type FormSubmitEvent } from '@nuxt/ui'
Expected behavior: The import should consistently work without throwing this error. As documented on nuxt ui's site.
Actual behavior: The error appears sporadically, without clear cause.
Environment:
- Nuxt version: [3.17.5]
- @nuxt/ui version: [3.2.0]
- Node.js version: [20]
- OS: [Linux]
Additional context: The error does not always occur, making it difficult to reproduce reliably.