-
Upgrading a site from v3 to v4 I keep getting this cryptic error message:
It comes from lmdb but it's not clear to me what is meant by "key" here, how to debug this problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The problem here occurs in conjunction with plugin https://github.com/Kornil/gatsby-plugin-google-analytics-reporter Apparently LMDB cannot accept keys longer than 1978 characters but relative URLs with arguments fetched by gatsby-plugin-google-analytics-reporter can sometimes be longer. See the related ticket: Kornil/gatsby-plugin-google-analytics-reporter#8 Why is the LMDB key length so limited - will the limit be increased or abandoned anytime soon? |
Beta Was this translation helpful? Give feedback.
-
It is very unlikely that we'll change the default key length as that would open the door for decreased performance. In this instance the plugin is at fault as the Instead of passing the full Helper function: https://www.gatsbyjs.com/docs/reference/config-files/node-api-helpers/#createNodeId Truncating the path before passing it into |
Beta Was this translation helpful? Give feedback.
It is very unlikely that we'll change the default key length as that would open the door for decreased performance. In this instance the plugin is at fault as the
id
should be generated withcreateNodeId()
.Instead of passing the full
path
as anid
it should use thecreateNodeId()
helper function:https://github.com/Kornil/gatsby-plugin-google-analytics-reporter/blob/7ae7c6f67f880c0311645d5ef369bb749a100054/gatsby-node.js#L63
Helper function: https://www.gatsbyjs.com/docs/reference/config-files/node-api-helpers/#createNodeId
Truncating the path before passing it into
createNodeId()
is probably not necessary.