Skip to content

Incompatible import of resolveConfig with TailwindCSS 3.3+ #299

@joelpittet

Description

@joelpittet

Describe the bug
When using @wingsuit-designsystem/preset-tailwind with TailwindCSS 3.3 or higher, we encounter the following error during build:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './resolveConfig' is not defined by "exports" in tailwindcss/package.json

This is due to a direct require('tailwindcss/resolveConfig') statement in Tailwind2JsonPlugin.js. TailwindCSS 3.3+ restricts subpath imports via the exports field.

To Reproduce
Update dependencies and try to run:

yarn run build:drupal

Expected behavior
No error

Proposed resolution
Update the code to import resolveConfig via the main package entry point:

// Before
const resolveConfig = require('tailwindcss/resolveConfig');

// After
const { resolveConfig } = require('tailwindcss');

This ensures compatibility with newer versions of TailwindCSS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions