We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was getting this weird issue when using React + Vite + Styled-Components + SSR + SWC with @swc/plugin-styled-components
This is how my vite config file looks like:
import { defineConfig, splitVendorChunkPlugin } from 'vite'; import react from '@vitejs/plugin-react-swc'; import { nodePolyfills } from 'vite-plugin-node-polyfills'; // https://vitejs.dev/config/ export default defineConfig({ esbuild: { drop: ['console', 'debugger'] }, plugins: [ react({ plugins: [['@swc/plugin-styled-components', { displayName: true, fileName: true, ssr: true, }]] }), nodePolyfills(), splitVendorChunkPlugin() ], });
Solved this by changing the import statement to: import {styled} from styled-components;
import {styled} from styled-components;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I was getting this weird issue when using React + Vite + Styled-Components + SSR + SWC with @swc/plugin-styled-components
This is how my vite config file looks like:
Solved this by changing the import statement to:
import {styled} from styled-components;
The text was updated successfully, but these errors were encountered: