Skip to content

TailwindCDN breaks when loading a custom plugin within an iframe #11899

Closed
@g-danna

Description

@g-danna

What version of Tailwind CSS are you using?

v3.7.2

What build tool are you using?

parcel v2.0.0, but it seems unrelated (also tried on esbuild v0.17.19)

What version of Node.js are you using?

v14.18.1 (also tried on v18.14.2)

What browser are you using?

Chrome, Firefox

What operating system are you using?

macOS

Reproduction URL

https://codesandbox.io/s/tailwindcdn-with-cusotm-plugins-in-iframe-gj9fkl

Describe your issue

TailwindCDN breaks when loading a custom plugin within an iframe.

It works flawlessly with custom plugins outside iframes, as you can see at this CodeSandbox link. Here, the logic is similar to one of the bug reproduction – the assigned tailwind.config is the same.

However, when you place it within an iframe, it throws "raws is undefined" from ...t[1].raws.tailwind in the producion code.

The issue seems to be adding plugins. If you uncomment the example custom plugin from the plugins array in the bug reproduction code (/index.mjs, line 23), it loads properly.

Am I doing something wrong? I'd be happy to contribute.

Metadata

Metadata

Assignees

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