Closed marcammann closed 6 years ago
I am getting the same issue as well.
Details below if it's useful
TypeError: EntitiesRepo is not a constructor
- fetch.js:14
[mad]/[gatsby-source-datocms]/fetch.js:14:12
- next_tick.js:150 process._tickCallback
internal/process/next_tick.js:150:11
error UNHANDLED REJECTION
TypeError: Cannot read property 'filter' of undefined
- api-runner-node.js:257 Promise.mapSeries.catch.then.results
[mad]/[gatsby]/dist/utils/api-runner-node.js:257:42
- util.js:16 tryCatcher
[mad]/[bluebird]/js/release/util.js:16:23
- promise.js:512 Promise._settlePromiseFromHandler
[mad]/[bluebird]/js/release/promise.js:512:31
- promise.js:569 Promise._settlePromise
[mad]/[bluebird]/js/release/promise.js:569:18
- promise.js:614 Promise._settlePromise0
[mad]/[bluebird]/js/release/promise.js:614:10
- promise.js:693 Promise._settlePromises
[mad]/[bluebird]/js/release/promise.js:693:18
- async.js:133 Async._drainQueue
[mad]/[bluebird]/js/release/async.js:133:16
- async.js:143 Async._drainQueues
[mad]/[bluebird]/js/release/async.js:143:10
- async.js:17 Immediate.Async.drainQueues [as _onImmediate]
[mad]/[bluebird]/js/release/async.js:17:14
Here is my dependencies from package.json
"dependencies": {
"babel-plugin-styled-components": "^1.5.1",
"gatsby": "next",
"gatsby-image": "next",
"gatsby-plugin-react-helmet": "next",
"gatsby-plugin-sharp": "^2.0.0-beta.7",
"gatsby-plugin-styled-components": "^3.0.0-beta.3",
"gatsby-source-datocms": "^2.0.0-alpha.2",
"gatsby-transformer-sharp": "^2.1.1-beta.6",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-helmet": "^5.2.0",
"react-reveal": "^1.2.2",
"react-tooltip": "^3.6.1",
"styled-components": "^3.3.3",
"typeface-lato": "0.0.54"
},
I have also tried deleting my lock file, removing npm, reinstalling. No luck.
I too am getting this error with an otherwise vanilla gatsby starter. Has something changed in the plugin recently? Or is this an issue with the Dato CMS API?
"dependencies": {
"dotenv": "^6.0.0",
"gatsby": "^1.9.247",
"gatsby-link": "^1.6.40",
"gatsby-plugin-react-helmet": "^2.0.10",
"gatsby-source-datocms": "^1.1.11",
"react-helmet": "^5.2.0"
},
...
module.exports = {
siteMetadata: {
title: 'Gatsby Default Starter',
},
plugins: [
'gatsby-plugin-react-helmet',
{
resolve: `gatsby-source-datocms`,
options: {
apiToken: process.env.DATO_API_TOKEN,
preview: false,
disableLiveReload: false,
},
},
],
}
Gett the same error here. Package.json and gatsby config:
"dependencies": {
"autoprefixer": "^9.0.1",
"final-form": "^4.8.3",
"gatsby": "^1.9.277",
"gatsby-link": "^1.6.45",
"gatsby-plugin-react-helmet": "^2.0.11",
"gatsby-plugin-react-next": "^1.0.11",
"gatsby-source-datocms": "^1.1.11",
"moment": "^2.22.2",
"prop-types": "^15.6.2",
"pure-react-carousel": "^1.13.2",
"react-datepicker": "^1.5.0",
"react-final-form": "^3.6.4",
"react-helmet": "^5.2.0",
"react-parallax": "^1.8.0"
},
...
module.exports = {
siteMetadata: {
title: 'Site Title',
},
plugins: [
`gatsby-plugin-react-next`,
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-datocms`,
options: {
apiToken: process.env.DATO_CMS_TOKEN,
previewMode: false,
apiUrl: `https://site-api.datocms.com`,
},
}
],
}
Error message
TypeError: EntitiesRepo is not a constructor
- fetch.js:14
[gatsby-testing]/[gatsby-source-datocms]/fetch.js:14:12
- next_tick.js:131 _combinedTickCallback
internal/process/next_tick.js:131:7
- next_tick.js:180 process._tickCallback
internal/process/next_tick.js:180:9
We should have fixed the issue with v2.0.0-alpha.5
I tried setting up a vanilla Gatsby v2 instance this morning and I'm getting stuck right after the configuration.
Using version gatsby-source-datocms @ 2.0.0-alpha.2 and datocms-client @ 0.5.7 (tried 0.6.0 as well)
This is the error:
What I tracked it down to is that the default exports from
datocms-client
need an extra.default
argument asdefault
isn't not automatically resolved. I found some notes that Babel now doesn't automatically access thedefault
property anymore. Even trying to setoutput.libraryExport
in the Webpack config override didn't do the trick.