模块构建失败:不允许插件/预设文件导出对象,仅导出功能

时间:2018-11-03 19:58:39

标签: javascript html reactjs babel gatsby

我正在尝试运行netlify.toml文件,但是在尝试运行netlify-lambda serve functions时遇到问题。然后,我收到以下错误消息:

  

错误:找不到模块'@ babel / plugin-transform-object-assign'

但是当我从终端运行gatsby develop时,出现以下错误消息:

  

错误:模块构建失败:错误:插件/预设文件不允许展示对象,仅用于展示功能。

所以我对这里发生的事情感到非常困惑。

这是package.json文件中的代码:

{
  "name": "gatsby-starter-default",
  "description": "Gatsby default starter",
  "version": "1.0.0",
  "author": "Kyle Mathews <mathews.kyle@gmail.com>",
  "dependencies": {
    "@babel/core": "^7.1.2",
    "@babel/preset-react": "^7.0.0",
    "babel": "^6.23.0",
    "babel-plugin-object-assign": "^1.2.1",
    "gatsby": "^1.9.277",
    "gatsby-link": "^1.6.46",
    "gatsby-plugin-react-helmet": "^2.0.11",
    "gatsby-source-contentful": "^1.3.54",
    "react-helmet": "^5.2.0",
    "styled-components": "^3.4.9",
    "url-loader": "^1.0.1"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "scripts": {
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --write 'src/**/*.js'",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "devDependencies": {
    "@babel/plugin-proposal-class-properties": "^7.1.0",
    "babel-cli": "^6.26.0",
    "babel-core": "^6.26.3",
    "babel-loader": "^8.0.0-beta.6",
    "babel-preset-env": "^1.7.0",
    "babel-preset-react": "^6.24.1",
    "babel/plugin-transform-object-assign": "^7.0.0",
    "prettier": "^1.13.7"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gatsbyjs/gatsby-starter-default"
  }
}

我使用的gatsby-config.js:

plugins: [
    'gatsby-plugin-react-helmet',
    {
      resolve: 'gatsby-source-contentful',
      options: {
        spaceId: 'k9f8fpq6e7c3'
      }
    }
  ]

0 个答案:

没有答案