Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

420
Views
Error de importación del enrutador de alcance Gatsbyjs rompiendo el sitio

Estaba trabajando en mi proyecto Gatsby e intenté agregar el paquete React Cookie Consent . Después de instalarlo e intentar implementarlo, mi sitio se descompuso, probándome con este error:

 warn ./.cache/root.js Attempted import error: 'BaseContext' is not exported from '@gatsbyjs/reach-router' (imported as 'BaseContext').

Parece que no puedo encontrar una solución, ni sé por qué está sucediendo. Localhost me arroja este error:

 _gatsbyjs_reach_router__WEBPACK_IMPORTED_MODULE_2__.BaseContext is undefined

¡Cualquier ayuda es bienvenida! Gracias :)

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Al intentar eliminar la carpeta de caché ejecutando:

 gatsby clean

Si el problema persiste, intente omitir la limitación de SSR agregando lo siguiente a su gatsby-node.js :

 exports.onCreateWebpackConfig = ({actions, loaders, stage}) => { if (stage === "build-html") { actions.setWebpackConfig({ module: { rules: [ { test: /react-cookie-consent/, use: loaders.null(), }, ], } }) } };

O usando una importación dinámica:

 useEffect(() => { (async () => { const { getCookieConsentValue, Cookies } = await import('react-cookie-consent') getCookieConsentValue('test') Cookies.get() })() }, [])

Puede consultar otros enfoques en:https://github.com/Mastermindzh/react-cookie-consent/issues/136

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!