Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Access to external resource blocked by CORS policy

Abierto
#187 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
javascript
Área
backend

Línea de trabajo

Reproduce the prerender request that triggers the CORS preflight, using the Google Fonts URL and the Contentful-backed page described in the report. Compare localhost and production behavior, then establish whether external resources can load during prerendering; done means the behavior is fixed or its production limitation is clearly documented.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

When trying to test prerender I get a failure with the following error:

019-08-26T11:15:21.130Z { source: 'javascript',
  level: 'error',
  text:
   'Access to font at \'https://fonts.gstatic.com/s/montserrat/v14/JTURjIg1_i6t8kCHKm45_cJD3gnD_vx3rCs.woff2\' from origin \'http://localhost:2200\' has been blocked by CORS policy: Request header field x-prerender is not allowed by Access-Control-Allow-Headers in preflight response.',
  timestamp: 1566818121129.915,
  url: 'http://localhost:2200/experience/play' }
2019-08-26T11:15:21.131Z - 0 https://fonts.gstatic.com/s/montserrat/v14/JTURjIg1_i6t8kCHKm45_cJD3gnD_vx3rCs.woff2
2019-08-26T11:15:21.131Z { source: 'network',
  level: 'error',
  text: 'Failed to load resource: net::ERR_FAILED',
  timestamp: 1566818121130.127,
  url:
   'https://fonts.gstatic.com/s/montserrat/v14/JTURjIg1_i6t8kCHKm45_cJD3gnD_vx3rCs.woff2',
  networkRequestId: '1000027665.19' }

Google fonts isn't mission critical for render, however I am also loading content dynamically from a CMS (https://contentful.com) that is. Metadata and all content is loaded here. If the policy can't be bypassed then prerender is effectively useless for my use case. I'm not an expert on CORS here, if this is only an issue for localhost then this may not be a problem, however if the same thing would happen on production then it would be a problem.

Any recommendations?

Lenguaje dominante
JavaScript
Estrellas
921
Forks
185
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de prerender/prerender-node

Todos los issues de prerender/prerender-node

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.