question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

yarn build command fails with styled components in ssg mode

See original GitHub issue

Description

When running yarn build

with babel-plugin-styled-components it fails with error: [vite-plugin-ssr:autoFullBuild] Cannot read properties of undefined (reading 'withConfig') [vite-plugin-ssr:autoFullBuild] Cannot read properties of undefined (reading 'withConfig') (x2) error during build: TypeError: Cannot read properties of undefined (reading 'withConfig')

without babel-plugin-styled-components it fails with error: [vite-plugin-ssr:autoFullBuild] styled.div is not a function [vite-plugin-ssr:autoFullBuild] styled.div is not a function (x2) error during build: TypeError: styled.div is not a function

vite.config.ts

Снимок экрана 2022-10-12 в 17 20 55

/renderer/_default.server.page.tsx

Снимок экрана 2022-10-12 в 17 24 25

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
brilloutcommented, Oct 14, 2022

It’s likely a styled-components bug, so I’d reach out to these guys.

0reactions
brilloutcommented, Oct 14, 2022

Apologies for the confusing [vite-plugin-ssr:autoFullBuild] prefix, I’ll try to fix this (it’s a Rollup thing so not sure I’ll be able to get rid of the prefix).

Done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vite js yarn build command fails with styled components in ssg ...
Description. When running yarn build. with babel-plugin-styled-components it fails with error: [vite-plugin-ssr:autoFullBuild] Cannot read ...
Read more >
Problem with the setup of the project · Issue #3688 - GitHub
Add styled components as a dependency to packages/sandbox/package.json · Build the styled components by running yarn build · Start the next server ...
Read more >
styled components not working in prod nextjs - You.com
I've followed the example for nextjs styled-components. The example works out of the box. However, once you create a styled-component, the className did...
Read more >
React Boilerplate: Everything You Need to Quick-Start a New ...
This article shows you the boilerplate that we actively use when creating new React application projects. The boilerplate includes ...
Read more >
styled-components | Yarn - Package Manager
styled -components ... Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found