You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How are you deploying your application? (if relevant)
No response
Describe the Bug
When using a local variable in a css template literal as a parameter for a function execution, it fails the build with ReferenceError: x is not defined.
export default function Home() {
const { x } = { x: 4 };
return (
<div
css={css`
// ReferenceError: x is not defined
${myCss(x)}
`}
/>
);
}
const myCss = (x: number) => css`
margin: ${x}px;
`;
Expected Behavior
Should compile. Worked fine in next.js <12.2.0, and works fine with babel.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
When using a local variable in a css template literal as a parameter for a function execution, it fails the build with
ReferenceError: x is not defined
.Expected Behavior
Should compile. Worked fine in next.js <12.2.0, and works fine with babel.
Link to reproduction
https://stackblitz.com/edit/vercel-next-js-8dfxwb?file=pages/index.tsx
To Reproduce
Just run
npm run build
in the example repo.The text was updated successfully, but these errors were encountered: