Gatsby 5.4.0 fails to import yaml
files
#37453
Labels
status: confirmed
Issue with steps to reproduce the bug that’s been verified by at least one reviewer.
topic: webpack/babel
Webpack or babel
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
Using Gatsby v5, when you try to import a
yaml
file, you get an error from theyaml-loader
.Reproduction Link
https://github.com/pettinarip/gatsby-5-yaml
Steps to Reproduce
import yamlFile from './test.yaml'
)gatsby develop
Expected Result
gatsby-develop
runs without any error when you try to import a yaml fileNote: I've tried doing this but it didn't work.
Actual Result
ERROR UNKNOWN
Module parse failed: Unexpected token "e" (0x65) in JSON at position 0 while parsing near "export
default [{id:..."
File was processed with these loaders:
You may need an additional loader to handle the result of these loaders.
JSONParseError: Unexpected token "e" (0x65) in JSON at position 0 while parsing near "export default
[{id:..."
at JsonParser.parse (/home/lap/gatsby-yaml/node_modules/webpack/lib/json/JsonParser.js:43:7)
at /home/lap/gatsby-yaml/node_modules/webpack/lib/NormalModule.js:1087:26
at processResult (/home/lap/gatsby-yaml/node_modules/webpack/lib/NormalModule.js:800:11)
at /home/lap/gatsby-yaml/node_modules/webpack/lib/NormalModule.js:860:5
at /home/lap/gatsby-yaml/node_modules/loader-runner/lib/LoaderRunner.js:407:3
at iterateNormalLoaders
(/home/lap/gatsby-yaml/node_modules/loader-runner/lib/LoaderRunner.js:233:10)
at iterateNormalLoaders
(/home/lap/gatsby-yaml/node_modules/loader-runner/lib/LoaderRunner.js:240:10)
at /home/lap/gatsby-yaml/node_modules/loader-runner/lib/LoaderRunner.js:255:3
at runSyncOrAsync
(/home/lap/gatsby-yaml/node_modules/loader-runner/lib/LoaderRunner.js:143:11)
at iterateNormalLoaders
(/home/lap/gatsby-yaml/node_modules/loader-runner/lib/LoaderRunner.js:251:2)
at iterateNormalLoaders
(/home/lap/gatsby-yaml/node_modules/loader-runner/lib/LoaderRunner.js:240:10)
at /home/lap/gatsby-yaml/node_modules/loader-runner/lib/LoaderRunner.js:255:3
at runSyncOrAsync
(/home/lap/gatsby-yaml/node_modules/loader-runner/lib/LoaderRunner.js:143:11)
at iterateNormalLoaders
(/home/lap/gatsby-yaml/node_modules/loader-runner/lib/LoaderRunner.js:251:2)
at /home/lap/gatsby-yaml/node_modules/loader-runner/lib/LoaderRunner.js:224:4
at /home/lap/gatsby-yaml/node_modules/webpack/lib/NormalModule.js:834:15
ModuleParseError: Module parse failed: Unexpected token "e" (0x65) in JSON at position 0 while parsin
g near "export default [{id:..."
File was processed with these loaders:
You may need an additional loader to handle the result of these loaders.
JSONParseError: Unexpected token "e" (0x65) in JSON at position 0 while parsing near "export default
[{id:..."
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: