Skip to content

TypeError: transform is not a function #263

@MrOldProger

Description

@MrOldProger

The next code produces this error:

import transform from 'css-to-react-native-transform';
(async function () {

    const result = transform(".cl{}");
    console.log(result);

})().catch(err => {
    console.log("global error", err);
}).finally(async () => {
    process.exit(0);
});

But if I change transform(".cl{}"); to transform.default(".cl{}"); all works fine.

My project uses "type": "module" in package.json

I've created the new empty project with only above code and only one package in package.json - error still here.

Node version: 22.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions