Skip to content

Parcel fails to import intlTelInput.css due to relative URLs #2059

@travisfisher-pdi

Description

@travisfisher-pdi

When attempting to import 'intlTelInput.css', Parcel fails, stating:

@parcel/transformer-css: Ambiguous url('../img/flags.webp') in custom property. Relative paths are resolved from the location the var() is used, not where the custom property is defined. Use an absolute URL instead

I looked into this further and it looks like Parcel moved to it's own CSS parser (Parcel CSS) back in 2022:

https://parceljs.org/blog/v2-4-0/

That parser is more strict than other commonly used parsers, especially as it pertains to the url function:

https://parceljs.org/languages/css/#url()

Please note that I did include the "overwrite" CSS variables recommended for the flags and images and used absolute paths, but this did not resolve the issue since the bundler sees the package's CSS as invalid and goes no further.

Any ideas on how I can bypass / ignore this error with Parcel?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions