我是盖茨比的新手,反应过来。我们正在为一个使用Gatsby和解耦drupal的小项目建立一个网站。我收到以下错误,因为我在运行"gatsby develop"时连接了前端和后端。
./node_modules/Gatsby/cache-dir/gatsby-browser-entry.js 22:4 中的错误 模块分析失败:意外令牌 (22:4(
You may need an appropriate loader to handle this file type.
|
| return (
> <React.Fragment>
| {finalData && render(finalData)}
| {!finalData && <div>Loading (StaticQuery)</div>}
@ ./src/pages/index.js 24:0-33 157:19-26
@ ./.cache/sync-requires.js
@ ./.cache/app.js
@ multi ./node_modules/event-source-polyfill/src/eventsource.js (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false
遇到此问题并找到以下解决方法:
// import { Link } from "gatsby" // error
import Link from "gatsby-link" // not error
它对我有用! :)
字体:https://github.com/gatsbyjs/gatsby/issues/10668#issuecomment-546596273