You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// in gatsby-ssr.jsexportconstnotExistingAPIHook=()=>{console.log("this won't show")}
will produce
ERROR #11329
Your plugins must export known APIs from their gatsby-ssr.js.
See https://www.gatsbyjs.org/docs/ssr-apis/ for the list of Gatsby ssr APIs.
- Your local gatsby-ssr.js is using the API "notExistingAPIHook" which is not a known API.
When there is default export:
// in gatsby-ssr.jsexportdefault()=>{console.log("this won't show")}
We don't get any warnings or errors, but it won't ever be executed by gatsby. Behaviour for exports should be consistent and we should warn about default exports as well
Right now we produce error when there are named export in
gatsby-ssr
orgatsby-browser
that don't match any of our API hooks ( https://www.gatsbyjs.org/docs/ssr-apis/ / https://www.gatsbyjs.org/docs/browser-apis/)For example:
will produce
When there is default export:
We don't get any warnings or errors, but it won't ever be executed by gatsby. Behaviour for exports should be consistent and we should warn about default exports as well
Task
Adjust
gatsby/packages/gatsby/src/bootstrap/resolve-module-exports.js
Lines 50 to 98 in d2fa8f7
to handle
default
exports as well and ideally add test case for that in https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/bootstrap/__tests__/resolve-module-exports.jsThe text was updated successfully, but these errors were encountered: