-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
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
[bug] Typescript + styled-components breaks app #3406
Comments
Also happening with chakra ui which is based on emotion. |
Probably related to #3416 |
By default we're freezing the prototype. You can set tauri.conf.json > security > freezePrototype to false to fix this problem. Note that you should freeze the prototype later if possible. Documentation on this will be updated soon. |
We're going to publish a new release changing the default value to false since this breaks on several frameworks. |
Describe the bug
I was recently trying to upgrade from 1.0.0-beta.8 to 1.0.0-rc.0. However, I was running into lots of errors. I've narrowed down a reproducible error with using styled-components and typescript in a React project. I tried my best to diagnose through styled-components, but the app works in the browser, just not a local Tauri app. The app was working in its entirety with 1.0.0-beta.8, but I'm not sure in which update this breaking change happened.
Reproduction
yarn create tauri-app
create-react-app
"@tauri-apps/api"
npm package1.0.0-rc.0
for "@tauri-apps/cli`yarn add styled-components @types/styled-components
yarn tauri dev
http://localhost:3000
Expected behavior
Tauri app window is not a blank screen. Should look like the browser view if you navigate to
http://localhost:3000
Platform and versions
$ tauri info Operating System - Windows, version 10.0.19042 X64 Webview2 - 98.0.1108.43 Visual Studio Build Tools: - Visual Studio Build Tools 2019 Node.js environment Node.js - 17.3.1 @tauri-apps/cli - 1.0.0-rc.0 @tauri-apps/api - 1.0.0-rc.0 Global packages npm - 8.3.0 pnpm - 6.11.0 yarn - 1.22.15 Rust environment rustc - 1.58.1 cargo - 1.58.0 Rust environment rustup - 1.24.3 rustc - 1.58.1 cargo - 1.58.0 toolchain - stable-x86_64-pc-windows-msvc App directory structure /.git /node_modules /public /src /src-tauri App tauri.rs - 1.0.0-rc.0 build-type - bundle CSP - default-src 'self' distDir - ../build devPath - http://localhost:3000/ framework - React
Stack trace
Additional context
I see that this is probably an issue with styled-components, but as I can only get the issue when running a Tauri app, I felt it best to bring the issue here in case the problem occurs with one of Tauri's dependencies
The text was updated successfully, but these errors were encountered: