File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
packages/gatsby-source-filesystem/src Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 11const chokidar = require ( `chokidar` )
22const fs = require ( `fs` )
3+ const path = require ( `path` )
34const { Machine } = require ( `xstate` )
45
56const { createFileNode } = require ( `./create-file-node` )
@@ -86,6 +87,19 @@ See docs here - https://www.gatsbyjs.org/packages/gatsby-source-filesystem/
8687 ` )
8788 }
8889
90+ // Validate that the path is absolute.
91+ // Absolute paths are required to resolve images correctly.
92+ if ( ! path . isAbsolute ( pluginOptions . path ) ) {
93+ reporter . warn ( `The path passed to gatsby-source-filesystem is relative:
94+
95+ ${ pluginOptions . path }
96+
97+ It is recommended to use an absolute path.
98+
99+ See docs here - https://www.gatsbyjs.org/packages/gatsby-source-filesystem/
100+ ` )
101+ }
102+
89103 const fsMachine = createFSMachine ( )
90104 let currentState = fsMachine . initialState
91105 let fileNodeQueue = new Map ( )
You can’t perform that action at this time.
0 commit comments