Gatsby: WebpackError: Invariant Violation: Minified React error # 62

Criado em 26 jan. 2019  ·  1Comentário  ·  Fonte: gatsbyjs/gatsby

Para que seja mais fácil ajudá-lo, inclua o máximo de informações úteis possível. Links úteis: - Documentação: https://www.gatsbyjs.org/docs/ Gatsby tem vários canais de suporte da comunidade, tente fazer sua pergunta em: - Discord: https://gatsby.app/discord - Spectrum: https: // espectro.chat/gatsby-js - Twitter: https://twitter.com/gatsbyjs Antes de abrir um novo problema, pesquise os problemas existentes https://github.com/gatsbyjs/gatsby/issues

Resumo

Gatsby build lança WebpackError: Invariant Violation: Minified React error #62 erro de gatsby develop works fine .

Informação relevante

error Building static HTML for pages failed

See our docs page on debugging HTML builds for help https://gatsby.app/debug-html

   8 |  else
   9 |          root["lib"] = factory(root["@reach/router"], root["core-js/modules/es6.array.iterator"], root["core-js/modules/es6.array.sort"], root["core-js/modules/es6.function.name"], root["core-js/modules/es6.map"], root["core-js/modules/es6.object.assign"], root["core-js/modules/es6.regexp.constructor"], root["core-js/modules/es6.regexp.split"], root["core-js/modules/es6.regexp.to-string"], root["core-js/modules/es6.string.ends-with"], root["core-js/modules/es6.string.iterator"], root["core-js/modules/web.dom.iterable"], root["fs"], root["lodash"], root["path"], root["react"], root["react-dom/server"], root["react-helmet"]);
> 10 | })(this, function(__WEBPACK_EXTERNAL_MODULE__reach_router__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_array_iterator__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_array_sort__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_function_name__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_map__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_object_assign__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_regexp_constructor__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_regexp_split__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_regexp_to_string__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_string_ends_with__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_es6_string_iterator__, __WEBPACK_EXTERNAL_MODULE_core_js_modules_web_dom_iterable__, __WEBPACK_EXTERNAL_MODULE_fs__, __WEBPACK_EXTERNAL_MODULE_lodash__, __WEBPACK_EXTERNAL_MODULE_path__, __WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom_server__, __WEBPACK_EXTERNAL_MODULE_react_helmet__) {
     |  ^
  11 | return


  WebpackError: Invariant Violation: Minified React error #62; visit https://reactjs.org/docs/error-decoder.html?invariant=62&args[]= for the full message  or use the non-minified dev environment for full errors and additional helpful warnings.

Esta é a mensagem de erro completa que estou recebendo. Tentei eliminar todos os mapeamentos errados de propriedades de estilo, conforme descrito na mensagem de erro React completa, mas o problema ainda persiste. Eu também excluí .cache .

Não sei o que mais poderia ser o problema, pois eu poderia fazer uma compilação bem-sucedida mais cedo e a mensagem não fornece mais nenhum insight sobre o que pode estar errado com meu código, especialmente porque posso executá-lo perfeitamente com gatsby develop .

Ambiente (se relevante)

`` `
Sistema:
SO: macOS 10.14.2
CPU: (8) x64 Intel (R) Core (TM) i7-4750HQ CPU @ 2,00 GHz
Shell: 3.2.57 - / bin / bash
Binários:
Nó: 11.7.0 - / usr / local / bin / node
Fio: 1.13.0 - / usr / local / bin / yarn
npm: 6.5.0 - / usr / local / bin / npm
Línguas:
Python: 2.7.10 - / usr / bin / python
Navegadores:
Chrome: 71.0.3578.98
Safari: 12.0.2
npmPacotes:
gatsby: ^ 2.0.76 => 2.0.76
imagem gatsby: ^ 2.0.20 => 2.0.25
gatsby-plugin-manifest: ^ 2.0.9 => 2.0.12
gatsby-plugin-offline: ^ 2.0.16 => 2.0.20
gatsby-plugin-react-helmet: ^ 3.0.2 => 3.0.5
gatsby-plugin-sharp: ^ 2.0.14 => 2.0.16
gatsby-source-filesystem: ^ 2.0.8 => 2.0.12
gatsby-transformador-afiado: ^ 2.1.8 => 2.1.9

### File contents (if changed)

`gatsby-config.js`:<!-- Please use a code block or just leave it as is if wasn't changed -->

module.exports = {
siteMetadata: {
título: Gatsby Starter ,
descrição: Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need. ,
autor: @gatsbyjs ,
socialLinks: [
{
nome: Link 1 ,
url: https://twitter.com/ ,
},
{
nome: link 2 ,
url: https://github.com/ ,
}
],
recursos: [
{
título: Feature 1 ,
descrição: Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need. ,
},
{
título: Feature 2 ,
descrição: Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need. ,
},
{
título: Feature 3 ,
descrição: Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need. ,
},
],
},
plugins: [
gatsby-plugin-react-helmet ,
{
resolver: gatsby-source-filesystem ,
opções: {
nome: images ,
caminho: ${__dirname}/src/images ,
},
},
gatsby-transformer-sharp ,
gatsby-plugin-sharp ,
{
resolver: gatsby-plugin-manifest ,
opções: {
nome: gatsby-starter-default ,
short_name: starter ,
start_url: / ,
background_color: #663399 ,
theme_color: #663399 ,
display: minimal-ui ,
ícone: src/images/gatsby-icon.png , // Este caminho é relativo à raiz do site.
},
},
// este plug-in (opcional) ativa a funcionalidade Progressive Web App + Offline
// Para saber mais, visite: https://gatsby.app/offline
// 'gatsby-plugin-offline',
],
}

`package.json`:<!-- Please use a code block or just leave it as is if wasn't changed -->

{
"nome": "gatsby-starter-default",
"privado": verdadeiro,
"descrição": "Um começo simples para se levantar e se desenvolver rapidamente com Gatsby",
"versão": "0.1.0",
"autor": "Kyle Mathews [email protected] ",
"dependências": {
"gatsby": "^ 2.0.76",
"imagem-gatsby": "^ 2.0.20",
"gatsby-plugin-manifest": "^ 2.0.9",
"gatsby-plugin-offline": "^ 2.0.16",
"gatsby-plugin-react-helmet": "^ 3.0.2",
"gatsby-plugin-sharp": "^ 2.0.14",
"gatsby-source-filesystem": "^ 2.0.8",
"gatsby-transformer-sharp": "^ 2.1.8",
"prop-types": "^ 15.6.2",
"reagir": "^ 16.6.3",
"react-dom": "^ 16.6.3",
"capacete de reação": "^ 5.2.0"
},
"palavras-chave": [
"gatsby"
],
"licença": "MIT",
"scripts": {
"build": "gatsby build",
"desenvolver": "gatsby desenvolver",
"start": "npm run development",
"format": "mais bonito --write \" src / * / .js \ "",
"test": "echo \" Escreva testes! -> https: //gatsby.app/unit-testing \ ""
},
"devDependencies": {
"mais bonita": "^ 1.15.2"
},
"repositório": {
"tipo": "git",
"url": " https://github.com/gatsbyjs/gatsby-starter-default "
},
"insetos": {
"url": " https://github.com/gatsbyjs/gatsby/issues "
}
}
`` gatsby-node.js : N/A <!-- Please use a code block or just leave it as is if wasn't changed --> gatsby-browser.js : N/A <!-- Please use a code block or just leave it as is if wasn't changed --> gatsby-ssr.js`: N / A

Comentários muito úteis

~ @AlexanderProd Estou tendo o mesmo problema; qual foi a sua causa? ~

Esqueça, no meu caso, eu estava usando

bodyAttributes={{
  style: 'some style string'
}}

dentro da instância gerada automaticamente de SEO.js <Helmet /> . Usar um objeto de estilo não estava funcionando, o que eu imagino ser um problema com o capacete de reação. Converter meu estilo em uma classe e usar isso resolveu meu problema.

Para outras pessoas que chegam pelo Google, o erro é uma invocação incorreta de style (ou seja, não use strings, use objetos).

>Todos os comentários

~ @AlexanderProd Estou tendo o mesmo problema; qual foi a sua causa? ~

Esqueça, no meu caso, eu estava usando

bodyAttributes={{
  style: 'some style string'
}}

dentro da instância gerada automaticamente de SEO.js <Helmet /> . Usar um objeto de estilo não estava funcionando, o que eu imagino ser um problema com o capacete de reação. Converter meu estilo em uma classe e usar isso resolveu meu problema.

Para outras pessoas que chegam pelo Google, o erro é uma invocação incorreta de style (ou seja, não use strings, use objetos).

Esta página foi útil?
0 / 5 - 0 avaliações

Questões relacionadas

totsteps picture totsteps  ·  3Comentários

andykais picture andykais  ·  3Comentários

dustinhorton picture dustinhorton  ·  3Comentários

theduke picture theduke  ·  3Comentários

timbrandin picture timbrandin  ·  3Comentários