Overview
I use the gatsby environment.
Since graphql is used in gatsby, useStaticQuery is used.
It works fine in the development environment(gatsby develop), In the environment after building(gatsby build && gatsby serve), an error like the title has occurred.
Error Text
Error: The result of this StaticQuery could not be fetched.
This is likely a bug in Gatsby and if refreshing the page does not fix it, please open an issue in https://github.com/gatsbyjs/gatsby/issues
Error code
const data = useStaticQuery(
graphql`
query {
allArticle(sort: { order: DESC, fields: updatedAt___seconds }) {
edges {
node {
category
id
thumbnail
title
createdAt {
seconds
}
}
}
}
allRanking {
edges {
node {
id
category
title
thumbnail
}
}
}
}
`
)
※ Since it worked correctly in secret mode, I wonder if something is wrong with the cache.
What I tried
Delete gatsby
$ yarn remove gatsby
$ rm -rf node_modules
$ yarn install
$ gatsby build && gatsby serve
exec gatsby clean command
$ gatsby clean
change component name and file
https://github.com/gatsbyjs/gatsby/issues/24902#issuecomment-847926225
delete .cache file
my environment
OS : MacOS
package.json
"dependencies": {
"firebase": "^8.6.7",
"gatsby": "^3.6.2",
"gatsby-plugin-advanced-sitemap": "^2.0.0",
"gatsby-plugin-clarity": "^1.0.0",
"gatsby-plugin-dark-mode": "^1.1.2",
"gatsby-plugin-google-adsense": "^1.1.3",
"gatsby-plugin-google-gtag": "^3.7.1",
"gatsby-plugin-manifest": "^3.6.0",
"gatsby-plugin-offline": "^4.6.0",
"gatsby-plugin-react-helmet": "^4.6.0",
"gatsby-plugin-twitter": "^3.12.0",
"gatsby-source-filesystem": "^3.7.1",
"react": "^17.0.1",
"react-calendar-heatmap": "^1.8.1",
"react-copy-to-clipboard": "^5.0.4",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0",
"react-lazyload": "^3.2.0",
"react-markdown": "5.0.3",
"react-scroll": "^1.8.2",
"react-slick": "^0.28.1",
"react-syntax-highlighter": "^15.4.3",
"react-tooltip": "^4.2.21",
"remark-gfm": "^1.0.0",
"slick-carousel": "^1.8.1",
"typescript": "^4.3.2"
},
It's difficult to guess what's going on, as you pointed it seems related to cache issues, however, you've tried all the cache-related stuff. I'd suggest:
Remove gatsby-plugin-offline and add gatsby-plugin-remove-serviceworker since you won't be using service-workers anymore
Check the importation path. It should be:
import { useStaticQuery } from 'gatsby';
Check the SEO component naming and importation (i.e: Seo.js or SEO.js). The same applies for Layout
Related
I am working on a Headless eCommerce website using Gatsby, Contentful. Shopify and Nacelle.
It works fine if I run the app using npm run dev, I can see all graphql data from Contentful.
That's what I mean is that all of graphql data can be fetched on the local side even npm run build, but it doesn't compile all of graphql data on production.
Here are some of the logs while building the gatsby app on Vercel.
The logs say that there's no errors, but I can see some of warnings from there.
Here's the graphql query, it works fine on local environment.
const HomePage = ({ data }) => {
console.log('slider in index page---', data);
...
}
export const query = graphql`
query {
homepageSlider: nacelleContent(type: { eq: "heroBanner" }, handle: { eq: "home-slider" }) {
title
remoteFields
featuredMedia {
remoteImage {
childImageSharp {
gatsbyImageData(height: 2500, placeholder: TRACED_SVG)
}
}
}
}
benefits: nacelleContent(type: { eq: "list" }, handle: { eq: "benefits" }) {
handle
title
remoteFields
}
certificates: ...
testimonial: ...
satisfacts: ...
collections: ...
}
}
If I check the console log on vercel, it says all of the data has null except collections.
But all of the data exist if I check console log on local environment.
Why does this happen? It seems like a gatsby or vercel issue.
// package.json
...
"dependencies": {
"#contentful/rich-text-from-markdown": "^15.0.0",
"#contentful/rich-text-react-renderer": "^15.0.0",
"#contentful/rich-text-types": "^15.0.0",
"#emotion/core": "^10.0.35",
"#loadable/component": "^5.14.1",
"#nacelle/client-js-sdk": "^3.1.0",
"#nacelle/gatsby-source-nacelle": "^2.10.2",
"#nacelle/react-components": "^2.10.1",
"#nacelle/react-dev-utils": "^2.10.1",
"#nacelle/react-hooks": "^2.11.2",
"#nacelle/react-recharge": "^2.11.0",
"#react-hook/media-query": "^1.1.1",
"autoprefixer": "^10.2.5",
"change-case": "^4.1.2",
"fuse.js": "^6.4.1",
"gatsby": "^2.27.0",
"gatsby-alias-imports": "^1.0.6",
"gatsby-plugin-emotion": "^4.5.0",
"gatsby-plugin-fullstory": "^3.2.0",
"gatsby-plugin-google-tagmanager": "^3.2.0",
"gatsby-plugin-image": "^1.1.2",
"gatsby-plugin-manifest": "^3.1.0",
"gatsby-plugin-postcss": "^4.1.0",
"gatsby-plugin-react-helmet": "^4.2.0",
"gatsby-plugin-scroll-reveal": "0.0.7",
"gatsby-plugin-sharp": "^2.9.0",
"gatsby-plugin-transition-link": "^1.20.5",
"gatsby-source-filesystem": "^2.6.1",
"gatsby-transformer-sharp": "^2.7.0",
"gsap": "^3.6.1",
"nuka-carousel": "^4.7.7",
"numeral": "^2.0.6",
"postcss": "^8.2.8",
"react": "^16.13.1",
"react-alice-carousel": "^2.5.1",
"react-dom": "^16.13.1",
"react-helmet": "^6.1.0"
},
"devDependencies": {
"#babel/core": "^7.11.1",
"#babel/plugin-proposal-optional-chaining": "^7.11.0",
"eslint": "^7.6.0",
"eslint-plugin-react": "^7.20.5",
"eslint-plugin-react-hooks": "^4.0.8",
"lint-staged": "^10.2.11",
"tailwindcss": "^2.0.4"
},
...
// gatsby-config.js
require('dotenv').config();
module.exports = {
plugins: [
{
resolve: '#nacelle/gatsby-source-nacelle',
options: {
nacelleSpaceId: process.env.GATSBY_NACELLE_SPACE_ID,
nacelleGraphqlToken: process.env.GATSBY_NACELLE_GRAPHQL_TOKEN,
cmsPreviewEnabled: process.env.NACELLE_PREVIEW_MODE,
contentfulPreviewSpaceId: process.env.CONTENTFUL_PREVIEW_SPACE_ID,
contentfulPreviewApiToken: process.env.CONTENTFUL_PREVIEW_API_TOKEN,
cacheDuration: 1000 * 60 * 60 * 24 // 1 day in ms
}
},
'gatsby-plugin-postcss',
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
start_url: `/`,
icon: `src/images/favicon-32.png`, // This path is relative to the root of the site.
}
},
'gatsby-transformer-sharp',
'gatsby-plugin-image',
'gatsby-plugin-emotion',
'gatsby-alias-imports',
'gatsby-plugin-react-helmet',
{
resolve: `gatsby-plugin-google-tagmanager`,
options: {
id: process.env.GOOGLE_TAG_MANAGER_ID,
includeInDevelopment: false,
},
},
`gatsby-plugin-scroll-reveal`,
// `gatsby-plugin-transition-link`
]
};
UPDATE:
Node v14.x is running on my local environment, and tried to select Node version 12 on the Vercel.
Many warning messages were disappeared, but I had no luck.
What I think that's weird is that I can see the content nodes difference between develop and build.
As you can see the images, it has created 128 content nodes while running npm run dev on the local side.
Otherwise, it has created only 100 content nodes on Vercel.
I am not sure if that is the main issue.
But basically gatsby has a rule of limitation for the content nodes?
Why does this happen? It seems like a gatsby or vercel issue.
It's hard to say with the provided details. To me, it seems that the Vercel server is facing a timeout response for some GraphQL queries/products/nodes (the warnings) so it could be a pang of shared guilt.
To debug and try to fix the issue at the same time, taking into account that the project works perfectly fine locally, I would try to match environments, starting by setting the same Node version. This will assure you that you are running the same dependency version.
Vercel allows you to configure the Node version from the backoffice or by setting a node property inside engine object in the package.json. From the docs:
Defining the node property inside engines of a package.json file
will override the selection made in the Project Settings and print a
Build Step warning if the version does not match.
In order to find out which Node.js version your Deployment is using,
run node -v in the Build Command or log the output of
process.version.
So add:
"engines": { "node": "12.x" }
Being 12.x the prompted version when running the node -v command.
Hopefully, this will fix your issue but if not, it would help you to debug better.
The site loses all functionalities after building it. In develop mode everything works fine, but when I build the website it looks like all scripts are missing. Bootstrap (Carousel DropDowns) are not responding, leflet map and background image not loading and react-multi-carousel do not work. I don't see any errors in the browser console, of course I ran gatsby clean before building. I uploaded the project to netlify. Below I am enclosing the json package:
{
"name": "Website",
"private": true,
"description": "Description",
"version": "0.1.0",
"license": "0BSD",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
"start": "npm run develop",
"serve": "gatsby serve",
"clean": "gatsby clean",
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
},
"dependencies": {
"#fortawesome/fontawesome-svg-core": "^1.2.35",
"#fortawesome/free-brands-svg-icons": "^5.15.3",
"#fortawesome/free-solid-svg-icons": "^5.15.3",
"#fortawesome/react-fontawesome": "^0.1.14",
"bootstrap": "^4.6.0",
"gatsby": "^3.2.1",
"gatsby-background-image": "^1.5.0",
"gatsby-image": "^3.2.0",
"gatsby-link": "^3.2.0",
"gatsby-plugin-image": "^1.2.0",
"gatsby-plugin-postcss": "^4.2.0",
"gatsby-plugin-react-helmet": "^4.2.0",
"gatsby-plugin-react-leaflet": "^3.0.0",
"gatsby-plugin-recaptcha": "^1.0.5",
"gatsby-plugin-robots-txt": "^1.5.5",
"gatsby-plugin-sass": "^4.2.0",
"gatsby-plugin-sharp": "^3.2.0",
"gatsby-plugin-sitemap": "^3.2.0",
"gatsby-remark-images": "^4.2.0",
"gatsby-source-filesystem": "^3.2.0",
"gatsby-transformer-remark": "^3.2.0",
"gatsby-transformer-sharp": "^3.2.0",
"gbimage-bridge": "^0.1.2",
"leaflet": "^1.7.1",
"node-sass": "^5.0.0",
"postcss": "^8.2.9",
"react": "^17.0.2",
"react-animations": "^1.0.0",
"react-bootstrap": "^1.5.2",
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-leaflet": "^3.1.0",
"react-multi-carousel": "^2.6.2",
"react-scripts": "^4.0.3",
"styled-components": "^5.2.3"
},
"devDependencies": {
"http-proxy-middleware": "^1.1.0",
"netlify-lambda": "^2.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1"
}
}
There's not much debug in the question however, to me, it seems that you are using some dependencies outside React's scope, which may potentially block React's hydration process, which may explain the problem described. For example, using Leaflet instead of React's Leaflet or (depending on its implementation) Bootstrap instead of React's Boostrap.
You should be able to change all React-unfriendly modules to React's ones without too much effort and that should fix your problems.
Keep in mind that if your project "work in develop and breaks in build" doesn't mean that your project work or stops working, it just means that is working under certain and specific circumstances. Basically, and summarizing (to avoid extending the answer), gatsby develop uses the browser as an interpreter, where there are, among other things, global objects like window or document. However, gatsby build occurs in the Node server, where at the build time, there are not global objects because there are not even created yet, that the main reason why you may face a different behavior between both scenarios but doesn't mean that the project stopped working magically.
You can read further details in the Overview of Gatsby Build Process.
Another option, linked with blocking React's hydration, is that some component may be blocking that process because of its own behavior. Be careful when using global objects like window or document (or when importing modules that uses it), they use should be always be wrapped inside the following condition, as you can see from the docs:
When referencing window in a React component.
import * as React from "react"
// Check if window is defined (so if in the browser or in node.js).
const isBrowser = typeof window !== "undefined"
export default function MyComponent() {
let loggedIn = false
if (isBrowser) {
window.localstorage.getItem("isLoggedIn") === "true"
}
return <div>Am I logged in? {loggedIn}</div>
}
Or when requiring a module:
// Requiring a function causes an error during builds
// as the code tries to reference window
const module = require("module") // Error
// Wrap the require in check for window
if (typeof window !== `undefined`) {
const module = require("module")
}
The same approach can be done using loadable components as the docs suggests but without providing any piece of code it's impossible to guess what should be its implementation.
I solved the problem by wrapping the leaflet maps in Loadable
import React from 'react';
import Loadable from "#loadable/component"
const LoadableMap = Loadable(() => import("./map.js"))
export default LoadableMap;
I have a project based on nextjs. Oddly enough, the HMR is not working properly for my project. Every time I make changes I have to re run the process. I have attached details of my next config and package.json:
next.config:
const withSass = require("#zeit/next-sass");
const withCSS = require("#zeit/next-css");
module.exports = withCSS(
withSass({
webpack(config, options) {
config.module.rules.push({
test: /\.(eot|woff|woff2|ttf|svg|png|jpg|gif)$/,
use: {
loader: "url-loader",
options: {
limit: 100000,
},
},
});
return config;
}
})
);
package.json
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"export": "next export"
},
"dependencies": {
"#zeit/next-css": "^1.0.1",
"#zeit/next-sass": "^1.0.1",
"antd": "^3.26.8",
"chartjs": "^0.3.24",
"classnames": "^2.2.6",
"draft-js": "^0.11.4",
"isomorphic-unfetch": "^3.0.0",
"moment": "^2.24.0",
"next": "^9.2.1",
"node-sass": "^4.13.1",
"react": "16.12.0",
"react-dom": "16.12.0",
"react-helmet": "^5.2.1",
"react-markdown": "^4.3.1",
"react-mde": "^8.1.0",
"react-redux": "^7.2.0",
"react-select": "^3.0.8",
"react-slick": "^0.25.2",
"react-toastify": "^5.5.0",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
"showdown": "^1.9.1",
"slick-carousel": "^1.8.1"
},
"devDependencies": {
"eslint": "^6.8.0",
"eslint-loader": "^3.0.3",
"eslint-plugin-react": "^7.18.3",
"url-loader": "^3.0.0"
}
I have tried removing node_modules and reinstalling again as well, doesnt seem to fix the issue.
Following is my project structure
Got help from #felixmosh. There was issue because of my folders were case was not matching route case. Fixed the issues by changing folder name to route names.
I just solved this problem by deleting folder ".next" and then closing terminal, and run npm run dev again.
Sometimes, when you accidentally name a component starting with a lowercase and then later changes to capital letter, next cache will still consider the older name and won't count it as a normal component.
The easiest solution is to copy the contents of the components, delete the file, and create one with a proper component name.
in my case hot reload didn't work because there was assetsPrefix in my next.config.js. You can remove or change them to "/" in the development mode and everything will be as expected.
For people NOT using modules and using Typescript paths.
For my setup, I just like having general .scss files
So, in my _app.tsx
I add Styles/index.scss
Then, in my index.scss
I add my #import '~Styles/flex.scss'
take note of the ~
this was required for it to work with hot reloading.
Wrt to Next js version 10+ and in addition to Pranay's answer, make sure your routes case matches the case of the folder.
Also, I noticed the component name has to start with the upper case. If your file name is dashboard.jsx, the component name should be Dashboard.
// home/dashboard.js
const Dashboard = () => {
....
}
export default Dashboard
I had to go to package.json remove react and react-dom and re add them with yarn add.
In my case, it wasn't working on Chrome. But it was working on Edge browser. And funny enough... even on a guest chrome window.
So all I had to do was...
Clear the cookies and hard refresh.
Force audit fix worked for me. Don't know the exact reason, might be some conflicts between dependencies.
Steps
1)Run this command in your next project directory.
npm audit fix --force
you need to run npm run dev instead npm run start
I use vue-cli project (that installed electron+seleniumWebDriver) run tests with ChromeDriver.
I keep running chromedriver (that installed in my vue-cli project) then I ran the test file 'node ff.js'.
The Electron app was run in screen but nothing happened. Then wait till the process exited, the result became error 'UnhandledPromiseRejectionWarning: WebDriverError: unknown error: DevToolsActivePort file doesn't exist'.
I searched the web for it and found the solution that the others claimed it works fine. It is just add a '--disable-dev-shm-usage' to chrome options. But it still error.
ff.js
const webdriver = require('selenium-webdriver')
const chrome = require('selenium-webdriver/chrome');
const driver = new webdriver.Builder()
// The "9515" is the port opened by chrome driver.
.usingServer('http://localhost:9515')
.withCapabilities({
chromeOptions: {
args: ['--headless', '--disable-gpu', '--no-sandbox', '--disable-extensions', '--disable-dev-shm-usage', 'start-minimized'],
// Here is the path to your Electron binary.
binary: './dist_electron/mac/myapp.app/Contents/MacOS/myapp'
}
})
.setChromeOptions(new chrome.Options().addArguments('--remote-debugging-port=7070'))
.forBrowser('electron')
.build()
driver.quit()
package.json
"devDependencies": {
"#types/chai": "^4.1.0",
"#types/mocha": "^5.2.4",
"#vue/cli-plugin-babel": "^3.5.0",
"#vue/cli-plugin-e2e-nightwatch": "^3.6.0",
"#vue/cli-plugin-eslint": "^3.5.0",
"#vue/cli-plugin-typescript": "^3.5.0",
"#vue/cli-plugin-unit-mocha": "^3.5.0",
"#vue/cli-service": "^3.5.0",
"#vue/eslint-config-standard": "^4.0.0",
"#vue/eslint-config-typescript": "^4.0.0",
"#vue/test-utils": "1.0.0-beta.29",
"babel-eslint": "^10.0.1",
"babel-plugin-istanbul": "^5.1.3",
"bootstrap": "^4.3.1",
"chai": "^4.1.2",
"chromedriver": "^73.0.0",
"copy-webpack-plugin": "^5.0.2",
"electron": "^4.0.0",
"electron-rebuild": "^1.8.4",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0",
"jquery": "^3.4.0",
"mocha": "^6.1.4",
"mochawesome": "^3.1.2",
"node-sass": "^4.9.0",
"nyc": "^14.0.0",
"popper.js": "^1.15.0",
"sass-loader": "^7.1.0",
"selenium-webdriver": "^4.0.0-alpha.1",
"ts-node": "^8.1.0",
"ts-protoc-gen": "^0.9.0",
"typescript": "^3.2.1",
"vue-cli-plugin-electron-builder": "^1.2.0",
"vue-template-compiler": "^2.5.21",
"vuex-module-decorators": "^0.9.8",
"webdriverio": "^5.8.3"
}
ps. I've tried with ChromeDriver#74.x.x, it still resulted same error.
Actually, I've tried with Selenium RobotFramework and still found the same error. I think it was something wrong with my test writing or some settings. (I'm not good in test tool.)
Just for information
mytest.robot
*** Settings ***
Library Selenium2Library
Variables vars.py
*** Test Cases ***
Foohaha
Create Webdriver Remote desired_capabilities=${binary_location} command_executor=http://localhost:9515
Log To Console ${item.get_attribute('innerHTML')}
[Teardown] Close All Browsers
P.s. The reason why not spectron is the tester I have only use the Selenium.
After I tried almost recommended testing library. I ended up with testcafe. Setting the pref app path to my distributed app's binary then set the page to open as html file in test file. The primary path was a default value.
This is how I set it up.
.testcafe-electron-rc
{
"mainWindowUrl": "app://./index.html",
"electronPath": "/Users/xxx/Documents/ProjectFolder/dist_electron/mac/my-lovely-app.app/Contents/MacOS/my-lovely-app",
"openDevTools": "true"
}
package.json
"scripts": {
...
"cafe": "testcafe \"electron:/Users/xxx/Documents/ProjectFolder/.testcafe-electron-rc\" \"/Users/xxx/Documents/ProjectFolder/tests/e2e/specs/testcafe.js\""
},
"devDependencies": {
...
"selenium-webdriver": "^4.0.0-alpha.1",
"testcafe": "^1.1.4",
"testcafe-browser-provider-electron": "0.0.8"
}
testcafe.js
import { Selector } from 'testcafe';
fixture(`Index page`)
.page('/Users/xxx/Documents/ProjectFolder/dist_electron/bundled/index.html');
test('Body > Paragraph contains "Hello World!"', async testController => {
const paragraphSelector = await new Selector('#nav > a.router-link-exact-active.router-link-active');
const txt = await new Selector('#app > div.auth-page > div > div > div > form > fieldset:nth-child(1) > input');
await testController.click(paragraphSelector)
.typeText(txt, 'Peter Parker');
// .expect(paragraphSelector.innerText).eql("Login");//.eql('Login');
});
Hope this will help someone.
Here's a gif of it:
http://www.giphy.com/gifs/3oKIP7arhKhNzNzytq
As you can see, whenever I click on it, it doesn't select.
Here's my exact code which is working in webpack:
https://www.webpackbin.com/bins/-KoaaPYxDno695fiUBMn
But in my starter kit environment, it doesn't seem to work. However, checkboxes seem to work. Any ideas?
"react": "^15.5.4",
"react-dom": "^15.5.4",
"material-ui": "^0.18.6",
EDIT: I also have react-tap-event-plugin and I've called it at the top of my client.js file. Also tried on the top of my Location.js file.
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();
Here's my full dependency list:
dependencies": {
"apisauce": "^0.14.0",
"babel-polyfill": "^6.23.0",
"bluebird": "^3.5.0",
"body-parser": "^1.17.2",
"classnames": "^2.2.5",
"cookie-parser": "^1.4.3",
"core-js": "^2.4.1",
"express": "^4.15.3",
"express-graphql": "^0.6.6",
"express-jwt": "^5.3.0",
"graphql": "^0.10.3",
"history": "^4.6.3",
"isomorphic-style-loader": "^2.0.0",
"jsonwebtoken": "^7.4.1",
"material-ui": "^0.18.6",
"node-fetch": "^1.7.1",
"normalize.css": "^7.0.0",
"passport": "^0.3.2",
"passport-facebook": "^2.1.1",
"pretty-error": "^2.1.1",
"prop-types": "^15.5.10",
"query-string": "^4.3.4",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-tap-event-plugin": "^2.0.1",
"sequelize": "^4.2.1",
"serialize-javascript": "^1.3.0",
"source-map-support": "^0.4.15",
"sqlite3": "^3.1.8",
"universal-router": "^3.2.0",
"whatwg-fetch": "^2.0.3"
},
You are most probably missing the react-tap-event-plugin.
Add it with npm install -save react-tap-event-plugin
I strugged with this problem for couple of days and found a solution. See if it works for you
Why was it not working?
If you look closely at the backend code of RadioButton you'll realize that it is actually similar to the Checkbox. I realized the problem was not only with RadioButtons but the checkbox was also not working (while the toggles were working fine).
I took my source code and ran it using CRA (Create React App) and it the RadioButtons were working perfectly. For RSK (React Starter Kit) the first suspect which was different was BrowserSync. I dug a little deeper and found that there is a config in BrowserSync for Ghost clicks which was to be turned off. You can read more about it here
https://github.com/callemall/material-ui/issues/2983
To turn off Ghost mode in your start script, goto /tools/start.js in your RSK Project folder and change config to
browserSync.create().init(
{
// https://www.browsersync.io/docs/options
server: 'src/server.js',
ghostMode: false,
middleware: [server],
open: !process.argv.includes('--silent'),
...(isDebug ? {} : { notify: false, ui: false }),
},
(error, bs) => (error ? reject(error) : resolve(bs)),
),