The astro-hydration build produces separate chunks for clsx and tailwind-merge when they're imported by drupal-canvas/utils.
These chunks are imported via relative paths (e.g., import {c as o} from "./clsx.js"), which bypass the cache-busting mechanism applied to entries in Canvas's import map (added in
🐛
Provide cache buster query string on imports
Active
).
This can cause runtime errors after deployments when old chunk versions are cached at edge or in browsers. The minified export names are not stable across builds (e.g., export {i as c}). When a browser loads a new utils.js expecting export {i as c} but serves a cached clsx.js with export {i as x}, the import fails:
Uncaught SyntaxError: The requested module './clsx.js' does not provide an export named 'c'
Configure the drupal-canvas package to bundle clsx and tailwind-merge using tsdown's noExternal option. This inlines the dependency code into drupal-canvas/utils, eliminating the separate chunks and their unstable relative imports.
This causes minor code duplication since Stub.jsx also imports clsx and tailwind-merge directly, creating separate chunks for those imports. (However, those direct imports go through the import map correctly, so cache-busting works.)
1.0
Theme builder
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.