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
When I try to build a production application, vite tries to externalize the "fs" package for the browser, but it shouldn't because "fs" is only used in the server-side function "formAction$". When I tried to do it in the native "routeAction$" function, everything worked as expected. This also occurs when using other node packages such as crypto, redis, etc.
npm run build
...
[plugin:vite:resolve] Module "fs" has been externalized for browser compatibility, imported by "/Users/tomstejskal/Work/qwik-modular-forms-bug/src/routes/index.tsx". See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
src/s_gw0o54lztzw.js (9:19) "read" is not exported by "__vite-browser-external", imported by "src/s_gw0o54lztzw.js".
...
This is related to a missing feature or implementation in Qwik. I will link the related issue for you later. Also, I plan to add this feature to Qwik next month.
You can try to wrap your code in if (isServer) {...}. This way the Qwik optimizer should be able to remove it from the client bundle. I will try investigate this issue this month.
When I try to build a production application, vite tries to externalize the "fs" package for the browser, but it shouldn't because "fs" is only used in the server-side function "formAction$". When I tried to do it in the native "routeAction$" function, everything worked as expected. This also occurs when using other node packages such as crypto, redis, etc.
Stackblitz project
The text was updated successfully, but these errors were encountered: