Closed jibin2706 closed 3 years ago
Hi!
Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.
If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.
Thanks for using Gatsby! ๐
Hi @LekoArts Here's the repo https://github.com/jibin2706/gatsby-example
๐ hello,
TL/DR: You are seeing the above error because there is an error in your gatsby-config.js
.
@jibin2706 in your repo you have an error specifically the gatsby-source-filesystem
points to a directory that doesn't exist (static/assets). The gatsby-source-filesystem
is required to use the
Simply change the path to something like path: ${__dirname}/images
.
@LekoArts this can be closed.
@AGarcia-Clarity i have updated the config still the error is present
@jibin2706 Oops sorry had a little typo in the path. path: ${__dirname}/src/images
Still the error is not related the path @AGarcia-Clarity
@jibin2706 You are right. It was related to outdated dependencies from gatsby-plugin-image
and gatsby-source-filesystem
. Made a PR on your example. Note however there are still errors with the gatsby-plugin-tsconfig-paths
@AGarcia-Clarity thanks for the fix
I tried to do the same our main repo but got these errors on the browser console. I had copied the package.json, yarn.lock & gatsby.config files to the main repo
static-image.server.tsx:52 Image not loaded https://loremflickr.com/640/360
eval @ static-image.server.tsx:52
renderWithHooks @ react-dom.development.js:14985
mountIndeterminateComponent @ react-dom.development.js:17811
beginWork @ react-dom.development.js:19049
beginWork$1 @ react-dom.development.js:23940
performUnitOfWork @ react-dom.development.js:22776
workLoopSync @ react-dom.development.js:22707
renderRootSync @ react-dom.development.js:22670
performSyncWorkOnRoot @ react-dom.development.js:22293
scheduleUpdateOnFiber @ react-dom.development.js:21881
updateContainer @ react-dom.development.js:25482
eval @ react-dom.development.js:26021
unbatchedUpdates @ react-dom.development.js:22431
legacyRenderSubtreeIntoContainer @ react-dom.development.js:26020
render @ react-dom.development.js:26103
eval @ app.js:174
setTimeout (async)
eval @ ready.js:37
eval @ app.js:169
Promise.then (async)
eval @ app.js:162
Promise.then (async)
eval @ app.js:52
./.cache/app.js @ commons.js:1563
options.factory @ commons.js:4019
__webpack_require__ @ commons.js:3391
(anonymous) @ commons.js:4729
__webpack_require__.O @ commons.js:3440
(anonymous) @ commons.js:4730
(anonymous) @ commons.js:4732
static-image.server.tsx:52 Please ensure that "gatsby-plugin-image" is included in the plugins array in gatsby-config.js, and that your version of gatsby is at least 2.24.78
eval @ static-image.server.tsx:52
renderWithHooks @ react-dom.development.js:14985
mountIndeterminateComponent @ react-dom.development.js:17811
beginWork @ react-dom.development.js:19049
beginWork$1 @ react-dom.development.js:23940
performUnitOfWork @ react-dom.development.js:22776
workLoopSync @ react-dom.development.js:22707
renderRootSync @ react-dom.development.js:22670
performSyncWorkOnRoot @ react-dom.development.js:22293
scheduleUpdateOnFiber @ react-dom.development.js:21881
updateContainer @ react-dom.development.js:25482
eval @ react-dom.development.js:26021
unbatchedUpdates @ react-dom.development.js:22431
legacyRenderSubtreeIntoContainer @ react-dom.development.js:26020
render @ react-dom.development.js:26103
eval @ app.js:174
setTimeout (async)
eval @ ready.js:37
eval @ app.js:169
Promise.then (async)
eval @ app.js:162
Promise.then (async)
eval @ app.js:52
./.cache/app.js @ commons.js:1563
options.factory @ commons.js:4019
__webpack_require__ @ commons.js:3391
(anonymous) @ commons.js:4729
__webpack_require__.O @ commons.js:3440
(anonymous) @ commons.js:4730
(anonymous) @ commons.js:4732
react_devtools_backend.js:2560 Image not loaded https://loremflickr.com/640/360
at eval (webpack-internal:///./node_modules/gatsby-plugin-image/dist/index.browser-6ab2b891.js:868:15)
at div
at section
at HomepageHero (webpack-internal:///./src/new/template/HomepageHero/HomepageHero.tsx:34:20)
at main
at GlobalStateProvider (webpack-internal:///./src/provider/GlobalStateProvider.tsx:38:23)
at Layout (webpack-internal:///./src/new/template/Layout/Layout.tsx:35:20)
at Homepage (webpack-internal:///./src/pages/index.tsx:144:19)
at PageRenderer (webpack-internal:///./.cache/page-renderer.js:23:29)
at PageQueryStore (webpack-internal:///./.cache/query-result-store.js:39:30)
at RouteHandler
at div
at FocusHandlerImpl (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:359:5)
at FocusHandler (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:330:19)
at RouterImpl (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:235:5)
at Location (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:64:23)
at Router
at ScrollHandler (webpack-internal:///./node_modules/gatsby-react-router-scroll/scroll-handler.js:36:35)
at RouteUpdates (webpack-internal:///./.cache/navigation.js:282:32)
at EnsureResources (webpack-internal:///./.cache/ensure-resources.js:22:30)
at LocationHandler (webpack-internal:///./.cache/root.js:67:29)
at LocationProvider (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:84:5)
at Location (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:64:23)
at Root
at ne (webpack-internal:///./node_modules/gatsby-plugin-image/dist/index.browser-6ab2b891.js:879:13)
at StaticQueryStore (webpack-internal:///./.cache/query-result-store.js:127:32)
at ErrorBoundary (webpack-internal:///./.cache/fast-refresh-overlay/components/error-boundary.js:24:35)
at DevOverlay (webpack-internal:///./.cache/fast-refresh-overlay/index.js:114:23)
at RootWrappedWithOverlayAndProvider
overrideMethod @ react_devtools_backend.js:2560
eval @ static-image.server.tsx:52
renderWithHooks @ react-dom.development.js:14985
updateFunctionComponent @ react-dom.development.js:17356
beginWork @ react-dom.development.js:19063
beginWork$1 @ react-dom.development.js:23940
performUnitOfWork @ react-dom.development.js:22776
workLoopSync @ react-dom.development.js:22707
renderRootSync @ react-dom.development.js:22670
performSyncWorkOnRoot @ react-dom.development.js:22293
eval @ react-dom.development.js:11327
unstable_runWithPriority @ scheduler.development.js:468
runWithPriority$1 @ react-dom.development.js:11276
flushSyncCallbackQueueImpl @ react-dom.development.js:11322
flushSyncCallbackQueue @ react-dom.development.js:11309
scheduleUpdateOnFiber @ react-dom.development.js:21893
dispatchAction @ react-dom.development.js:16139
_callee$ @ GlobalStateProvider.tsx:33
tryCatch @ runtime.js:45
invoke @ runtime.js:274
prototype.<computed> @ runtime.js:97
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
eval @ asyncToGenerator.js:32
eval @ asyncToGenerator.js:21
eval @ GlobalStateProvider.tsx:31
invokePassiveEffectCreate @ react-dom.development.js:23487
callCallback @ react-dom.development.js:3945
invokeGuardedCallbackDev @ react-dom.development.js:3994
invokeGuardedCallback @ react-dom.development.js:4056
flushPassiveEffectsImpl @ react-dom.development.js:23574
unstable_runWithPriority @ scheduler.development.js:468
runWithPriority$1 @ react-dom.development.js:11276
flushPassiveEffects @ react-dom.development.js:23447
performSyncWorkOnRoot @ react-dom.development.js:22269
eval @ react-dom.development.js:11327
unstable_runWithPriority @ scheduler.development.js:468
runWithPriority$1 @ react-dom.development.js:11276
flushSyncCallbackQueueImpl @ react-dom.development.js:11322
flushSyncCallbackQueue @ react-dom.development.js:11309
unbatchedUpdates @ react-dom.development.js:22438
legacyRenderSubtreeIntoContainer @ react-dom.development.js:26020
render @ react-dom.development.js:26103
eval @ app.js:174
setTimeout (async)
eval @ ready.js:37
eval @ app.js:169
Promise.then (async)
eval @ app.js:162
Promise.then (async)
eval @ app.js:52
./.cache/app.js @ commons.js:1563
options.factory @ commons.js:4019
__webpack_require__ @ commons.js:3391
(anonymous) @ commons.js:4729
__webpack_require__.O @ commons.js:3440
(anonymous) @ commons.js:4730
(anonymous) @ commons.js:4732
react_devtools_backend.js:2560 Please ensure that "gatsby-plugin-image" is included in the plugins array in gatsby-config.js, and that your version of gatsby is at least 2.24.78
at eval (webpack-internal:///./node_modules/gatsby-plugin-image/dist/index.browser-6ab2b891.js:868:15)
at div
at section
at HomepageHero (webpack-internal:///./src/new/template/HomepageHero/HomepageHero.tsx:34:20)
at main
at GlobalStateProvider (webpack-internal:///./src/provider/GlobalStateProvider.tsx:38:23)
at Layout (webpack-internal:///./src/new/template/Layout/Layout.tsx:35:20)
at Homepage (webpack-internal:///./src/pages/index.tsx:144:19)
at PageRenderer (webpack-internal:///./.cache/page-renderer.js:23:29)
at PageQueryStore (webpack-internal:///./.cache/query-result-store.js:39:30)
at RouteHandler
at div
at FocusHandlerImpl (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:359:5)
at FocusHandler (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:330:19)
at RouterImpl (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:235:5)
at Location (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:64:23)
at Router
at ScrollHandler (webpack-internal:///./node_modules/gatsby-react-router-scroll/scroll-handler.js:36:35)
at RouteUpdates (webpack-internal:///./.cache/navigation.js:282:32)
at EnsureResources (webpack-internal:///./.cache/ensure-resources.js:22:30)
at LocationHandler (webpack-internal:///./.cache/root.js:67:29)
at LocationProvider (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:84:5)
at Location (webpack-internal:///./node_modules/@gatsbyjs/reach-router/es/index.js:64:23)
at Root
at ne (webpack-internal:///./node_modules/gatsby-plugin-image/dist/index.browser-6ab2b891.js:879:13)
at StaticQueryStore (webpack-internal:///./.cache/query-result-store.js:127:32)
at ErrorBoundary (webpack-internal:///./.cache/fast-refresh-overlay/components/error-boundary.js:24:35)
at DevOverlay (webpack-internal:///./.cache/fast-refresh-overlay/index.js:114:23)
at RootWrappedWithOverlayAndProvider
also upgrading these packages resulted in the same error https://github.com/jibin2706/gatsby-example/tree/dev
"gatsby": "^3.6.0",
"gatsby-plugin-google-tagmanager": "^3.6.0",
"gatsby-plugin-manifest": "^3.6.0",
"gatsby-plugin-postcss": "^4.6.0",
"gatsby-plugin-react-helmet": "^4.6.0",
"gatsby-plugin-react-svg": "^3.0.1",
"gatsby-plugin-sass": "^4.6.0",
"gatsby-plugin-sharp": "^3.6.0",
"gatsby-plugin-typescript": "^3.6.0",
"gatsby-transformer-sharp": "^3.6.0",
I deleted the node_modules
and yarn.lock
and ran a fresh install with npm install
. Also any <StaticImage>
components require an alt prop.
@AGarcia-Clarity followed the same steps still facing the same error (i used yarn instead of npm)
FYI dynamic image with from strapi cms is working with gatsby-image-plugin, only static image component is giving issues
Hiya!
This issue has gone quiet. Spooky quiet. ๐ป
We get a lot of issues, so we currently close issues after 60 days of inactivity. Itโs been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! ๐ช๐
I met the same issue this afternoon, I followed "Using the Gatsby Image plugin" guide to add the plugins and edited my configs, but kept getting error. After debugging for 2 hours, I decided to init a new project for A/B test by running npm init gatsby
, and there was no error when using StaticImage
on the clean installed project. And then, back to my original project which has error when using StaticImage
, things weird, the error was gone, StaticImage
worked, and I cannot reproduce the issue anymore.
Hiya!
This issue has gone quiet. Spooky quiet. ๐ป
We get a lot of issues, so we currently close issues after 60 days of inactivity. Itโs been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! ๐ช๐
Hey again!
Itโs been 60 days since anything happened on this issue, so our friendly neighborhood robot (thatโs me!) is going to close it.
Please keep in mind that Iโm only a robot, so if Iโve closed this issue in error, Iโm HUMAN_EMOTION_SORRY
. Please feel free to comment on this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks again for being part of the Gatsby community! ๐ช๐
Description
Got this error when using StaticImage
Steps to reproduce
I had upgrade the from v2 to v3 and stared using the
gatsby-plugin-image
Expected result
Should proceed with no error
Actual result
Error when starting the dev server
Environment
Run
gatsby info --clipboard
in your project directory and paste the output here. Also name anyflags
you use insidegatsby-config.js
.Example Repo