@linaria/shaker process node_modules library error, it is socket.io-client library in my project #1310
Labels
bug report 🦗
Issue is probably a bug, but it needs to be checked
bundler: webpack 📦
Issue is related to webpack bundler
needs: complete repro 🖥️
Issue need to have complete repro provided
platform: ssr 🛠️
Issue related to SSR
Environment
"@linaria/core": "^4.5.4",
"@linaria/extractor": "^4.5.0",
"@linaria/logger": "^4.5.0",
"@linaria/preeval": "^3.0.0-beta.23",
"@linaria/react": "^4.5.4",
"@linaria/shaker": "^4.5.3",
"@linaria/utils": "^4.5.3",
"@linaria/vite": "^4.5.4",
Description
I upgrade my linaria version from "3.0.0-beta.15" to "4.5.0". linaria reported an error, that is
Failed to transpile /pages/index/Counter.tsx because: Cannot read properties of undefined (reading 'fd') in | /demo/vite-ssr-cli/node_modules/socket.io-client/lib/url.js | /demo/vite-ssr-cli/node_modules/socket.io-client/lib/index.js
my project depend on "socket.io-client" library, The error occurs when linaria handles the "socket.io-client"
i found linaria shaker would process all dependencies include node_modules. but sometimes it would be interrupted in some library. here is "socket.io-client"
how can i fix it,thanks
Reproducible Demo
Reproduce is very easy. it just has these code, it would be bugs
import { Manager } from "socket.io-client"; const socket = new Manager('ws://example.com') socket.on("disconnect", (reason) => { console.log(reason) }); const style = css
color: red;
``
demo on sandbox
https://codesandbox.io/p/sandbox/prod-meadow-ksk5x9?file=%2Fsrc%2FApp.tsx%3A11%2C1
The text was updated successfully, but these errors were encountered: