react-uwp
react-uwp copied to clipboard
Cross-Origin Request Blocked (segmdl2.eot) Firefox
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://cdnjs.cloudflare.com/ajax/libs/react-uwp/1.1.0/fonts/segmdl2.eot. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
FireFox seems to have this issue and can be assessed using firefox and going to https://www.react-uwp.com/ in the console.
@renshenhe thanks, i will check the log in FireFox environments.
@renshenhe hi, i have a good news to tell you, the react-uwp new version is support css-in-js style now, the render will be faster, also support inline-style, you can set in theme Config, example code:
import getTheme from "react-uwp/styles/getTheme";
const theme = getTheme({ useInlineStyle: false, themeName: dark, accent: "yellowgreen" });
@myxvisual I'm getting:
ReferenceError: document is not defined
at StyleManager.setupStyleElement (/Users/RenHe/projects/test/node_modules/src/styles/StyleManager.ts:67:27)
after dropping this a previously working SSR build. I'm not using next.js just standalone react's renderToString
.
Here's my a piece of the config:
import { Theme as UWPThemeProvider } from 'react-uwp/Theme';
import getTheme from 'react-uwp/styles/getTheme';
import setStaticAcrylicTexture from './setStaticAcrylicTexture';
const App = ({ userAgent }) => (
<UWPThemeProvider
theme={
getTheme({
useInlineStyle: false,
themeName: 'dark',
accent: '#0078d7',
useFluentDesign: true,
desktopBackgroundImage: '/static/assets/bgOcean.jpg',
userAgent: userAgent,
})
}
needGenerateAcrylic={false}
themeWillUpdate={setStaticAcrylicTexture}
>
//...
</UWPThemeProvider>
)
@renshenhe the ssr bug will be fixed at next version, repeat the same issue #16. When I am free, I will check FireFox bug, ty.
I'm curious about this file, why load the file https://cdnjs.cloudflare.com/ajax/libs/react-uwp/1.1.0/fonts/segmdl2.eot
from the remote server, but include it in the package. the developers should control all the thing of their project, as much as possible, isn't it?
@myxvisual at least an option to disable remote loading would be great!