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
I have a custom webpack 5 build that runs react in ssr.
I have a sprinkles file that looks like this:
import{defineProperties,createSprinkles,createMapValueFn}from'@vanilla-extract/sprinkles';constresponsiveAtomicProperties=defineProperties({conditions: {mobile: {},tablet: {'@media': `screen and (min-width: ${rem(breakpoints.tablet)})`},desktop: {'@media': `screen and (min-width: ${rem(breakpoints.desktop)})`},wide: {'@media': `screen and (min-width: ${rem(breakpoints.wide)})`},},// etc.
The webpack compiler throws an error:
Cannot read properties of undefined (reading 'conditions')
The stack looks like this:
TypeError: Cannot read properties of undefined (reading 'conditions')\n" +
' at sprinklesFn (/Users/paulcowan/projects/cuttingedge/apps/website/src/components/Footer/Footer.css.ts:7116:58)\n' +
' at atoms (/Users/paulcowan/projects/cuttingedge/apps/website/src/components/Footer/Footer.css.ts:11817:12)\n' +
' at /Users/paulcowan/projects/cuttingedge/apps/website/src/components/Footer/Footer.css.ts:12407:17\n' +
' at /Users/paulcowan/projects/cuttingedge/apps/website/src/components/Footer/Footer.css.ts:12502:3\n' +
' at /Users/paulcowan/projects/cuttingedge/apps/website/src/components/Footer/Footer.css.ts:12505:12\n' +
' at Script.runInContext (node:vm:139:12)\n' +
' at Script.runInNewContext (node:vm:144:17)\n' +
' at Object.module.exports [as default] (/Users/paulcowan/projects/cuttingedge/node_modules/.pnpm/[email protected]/node_modules/eval/eval.js:74:12)\n' +
' at Object.processVanillaFile (/Users/paulcowan/projects/cuttingedge/node_modules/.pnpm/@Vanilla-Extract[email protected]/node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.prod.js:85:50)\n' +
' at /Users/paulcowan/projects/cuttingedge/node_modules/.pnpm/@Vanilla-Extract[email protected][email protected]/node_modules/@vanilla-extract/webpack-plugin/loader/dist/vanilla-extract-webpack-plugin-loader.cjs.prod.js:58:38'
The error is coming from the @vanilla-extract/webpack-plugin which basically evals the code:
Is there anything obvious that jumps out from this error or is there an easier way to debug this? I'm curious to know if it is something obvious like no window object when running ssr.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a custom webpack 5 build that runs react in ssr.
I have a sprinkles file that looks like this:
The webpack compiler throws an error:
The stack looks like this:
The error is coming from the
@vanilla-extract/webpack-plugin
which basically evals the code:Is there anything obvious that jumps out from this error or is there an easier way to debug this? I'm curious to know if it is something obvious like no window object when running ssr.
Beta Was this translation helpful? Give feedback.
All reactions