当我将我的应用程序部署到Heroku时,我得到了以下错误:
remote: SyntaxError: src/resolvers/Mutation.js: Unexpected token (21:16)
remote: 19 | const user = await prisma.mutation.createUser({
remote: 20 | data: {
remote: > 21 | ...data,
remote: | ^
remote: 22 | password,
remote: 23 | permissions,
remote: 24 | authentication在Heroku后期构建阶段,其余的扩展是不被识别的。
我现在在index.js中有以下内容
import '@babel/polyfill'我的package.json
"dependencies": {
"@babel/polyfill": "^7.0.0",
"babel-cli": "^6.26.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0",
"bcryptjs": "^2.4.3",
"cross-fetch": "^2.2.2",
"env-cmd": "^8.0.2",
"google-auth-library": "^4.2.3",
"graphql": "^0.13.2",
"graphql-cli": "^2.16.4",
"graphql-yoga": "^1.14.10",
"jsonwebtoken": "^8.3.0",
"nodemailer": "^6.2.1",
"prisma-binding": "^2.1.1",
"stripe": "^7.1.0"
},
"devDependencies": {
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
"jest": "^23.5.0",
"nodemon": "^1.17.5"
}我试过_babelrc
{
"presets": [
"env"
],
"plugins": [
"transform-object-rest-spread"
]
}或
{
"presets": [
"react",
"es2015",
"stage-3",
"env"
],
"plugins": [
["@babel/plugin-proposal-object-rest-spread", { "loose": true, "useBuiltIns": true }],
"transform-es2015-destructuring"
]
}或
{
"presets": [
"env",
"stage-0",
"react"
]
}或
{
"presets": ["react", "es2015"],
"plugins": ["transform-es2015-destructuring", "transform-object-rest-spread"]
}但不管用。不知道该怎么解决这个问题。
.
发布于 2020-01-13 05:22:50
_babelrc不是babel的公认配置格式文件--为了配置babel,您需要使用配置文件文档中列出的方法之一
.babelrc.babelrc.js.babelrc.cjspackage.jsonhttps://stackoverflow.com/questions/59710467
复制相似问题