react-uwp icon indicating copy to clipboard operation
react-uwp copied to clipboard

Cross-Origin Request Blocked (segmdl2.eot) Firefox

Open renshenhe opened this issue 7 years ago • 6 comments

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 avatar Aug 05 '17 14:08 renshenhe

@renshenhe thanks, i will check the log in FireFox environments.

myxvisual avatar Aug 07 '17 01:08 myxvisual

@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 avatar Aug 08 '17 08:08 myxvisual

@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 avatar Aug 09 '17 23:08 renshenhe

@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.

myxvisual avatar Aug 10 '17 02:08 myxvisual

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?

Losses avatar Oct 06 '17 06:10 Losses

@myxvisual at least an option to disable remote loading would be great!

acidicX avatar Jul 11 '18 09:07 acidicX