<!-- Thank you for your contribution. Before you submit the issue:
1. Search open and closed issues for duplicates.
2. Read the contributing guidelines.
-->
Description
The web component renders a <style> tag containing a literal CSS
@import string instead of interpolating the cssImportPath value.
Specifically, the following code:
<style>@import '{finalCssImportPath}';</style>
does not interpolate finalCssImportPath in JSX. As a result, the
browser receives the CSS import as a literal string and the stylesheet
is never loaded.
This causes the component styles to be missing even when a valid
cssImportPath is provided.
This issue affects the web component rendering logic and occurs
consistently whenever the component is rendered.
Environment
- OS: Any
- Browser: Any modern browser
- Framework: React (web component usage)
Expected Result
The value of cssImportPath should be correctly interpolated into the
CSS @import statement so that the referenced stylesheet is loaded and
applied at runtime.
Actual Result
The rendered output contains a literal string:
@import '{finalCssImportPath}';
instead of the resolved CSS path, causing the stylesheet import to fail.
Steps to Reproduce
- Use the
AsyncApiWebComponent and provide a custom cssImportPath
prop.
- Render the component in a browser.
- Inspect the rendered
<style> tag in the DOM.
- Observe that
{finalCssImportPath} appears as a literal string and
the CSS file is not loaded.
Troubleshooting
- Verified that
cssImportPath contains a valid path.
- Confirmed that JSX does not interpolate variables inside string
literals.
- Identified that using a JSX expression (template literal) resolves
the issue, for example:
<style>{`@import '${finalCssImportPath}';`}</style>
Description
The web component renders a
<style>tag containing a literal CSS@importstring instead of interpolating thecssImportPathvalue.Specifically, the following code:
does not interpolate
finalCssImportPathin JSX. As a result, thebrowser receives the CSS import as a literal string and the stylesheet
is never loaded.
This causes the component styles to be missing even when a valid
cssImportPathis provided.This issue affects the web component rendering logic and occurs
consistently whenever the component is rendered.
Environment
Expected Result
The value of
cssImportPathshould be correctly interpolated into theCSS
@importstatement so that the referenced stylesheet is loaded andapplied at runtime.
Actual Result
The rendered output contains a literal string:
instead of the resolved CSS path, causing the stylesheet import to fail.
Steps to Reproduce
AsyncApiWebComponentand provide a customcssImportPathprop.
<style>tag in the DOM.{finalCssImportPath}appears as a literal string andthe CSS file is not loaded.
Troubleshooting
cssImportPathcontains a valid path.literals.
the issue, for example: