简体   繁体   English

无法从源加载函数定义:无法从函数源生成清单:SyntaxError:意外的标记“。”

[英]Failed to load function definition from source: Failed to generate manifest from function source: SyntaxError: Unexpected token '.'

I have been facing this firebase emulator error when I try to start the emulator and it stops suddenly by providing this error continuously:当我尝试启动模拟器时,我一直面临这个 firebase 模拟器错误,并且它通过连续提供此错误而突然停止:

Failed to load function definition from source: Failed to generate manifest from function source: SyntaxError: Unexpected token '.'无法从源加载函数定义:无法从函数源生成清单:SyntaxError:意外的标记“。”

I tried many different processes but couldn't find any possible solution to fix this.我尝试了许多不同的过程,但找不到任何可能的解决方案来解决这个问题。 I updated the firebase-function version as many of them gave that solution but that's not working with me.我更新了 firebase-function 版本,因为他们中的许多人都提供了该解决方案,但这对我不起作用。

在此处输入图像描述 My firebase.json file:我的 firebase.json 文件:

 { "hosting": { "predeploy": ["npm run --prefix client build"], "public": "client/out", "cleanUrls": true, "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], "rewrites": [ { "source": "/app/**", "function": "app" }, { "source": "/meeting/*", "destination": "/meeting.html" }, { "source": "/meeting", "destination": "/404.html" } ] }, "functions": { "source": "functions" }, "firestore": { "indexes": "firestore.indexes.json" }, "emulators": { "functions": { "port": 3002 }, "firestore": { "port": 3001 }, "ui": { "enabled": true } } }

package.json file of functions:函数的 package.json 文件:

 { "name": "@minimal/minimal-kit-react", "author": "minimals.cc", "version": "2.7.0", "private": true, "scripts": { "dev": "next dev -p 3222", "build": "next build && next export", "start": "next start", "lint": "eslint --ext.js,.jsx./src", "lint:fix": "eslint --fix --ext.js,.jsx./src" }, "browserslist": { "production": [ ">0.5%", "last 2 versions", "Firefox ESR", "not dead", "not IE 11", "maintained node versions" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "dependencies": { "@babel/preset-react": "^7.16.7", "@date-io/date-fns": "1.3.13", "@emotion/cache": "^11.6.0", "@emotion/react": "^11.7.0", "@emotion/server": "^11.4.0", "@emotion/styled": "^11.6.0", "@fullcalendar/daygrid": "^5.10.1", "@fullcalendar/interaction": "^5.10.1", "@fullcalendar/list": "^5.10.1", "@fullcalendar/react": "^5.10.1", "@fullcalendar/timegrid": "^5.10.1", "@fullcalendar/timeline": "^5.10.1", "@iconify/react": "^3.1.0", "@material-ui/pickers": "^3.3.10", "@mui/icons-material": "^5.2.4", "@mui/lab": "^5.0.0-alpha.59", "@mui/material": "^5.2.2", "@nandorojo/swr-firestore": "^0.16.0", "@zeit/next-css": "^1.0.1", "@zeit/next-sass": "^1.0.1", "axios": "^0.24.0", "change-case": "^4.1.2", "country-flag-icons": "^1.5.3", "date-fns": "^2.27.0", "firebase": "^9.6.1", "formik": "^2.2.9", "framer-motion": "^4.1.17", "jwt-check-expiration": "^1.0.5", "material-ui-phone-number": "^3.0.0", "moment": "^2.29.1", "next": "^12.0.7", "next-transpile-modules": "^9.0.0", "node-sass": "^4.14.1", "notistack": "^2.0.3", "nprogress": "^0.2.0", "otp-input-react": "^0.2.4", "prevent-orientation": "^2.1.0", "prop-types": "^15.7.2", "react": "17.0.2", "react-countdown": "^2.3.2", "react-dom": "17.0.2", "react-drag-drop-files": "^2.2.2", "react-intersection-observer": "^8.32.5", "react-lazy-load-image-component": "^1.5.1", "react-number-format": "^4.9.1", "react-otp-input": "^2.4.0", "react-phone-input-mui": "^2.9.4", "react-phone-number-input": "^3.1.44", "react-quill": "^2.0.0-beta.4", "react-screen-orientation": "^0.0.4", "simplebar": "^5.3.6", "simplebar-react": "^2.3.6", "stylis": "^4.0.10", "stylis-plugin-rtl": "^2.1.1", "timezone-support": "^2.0.2", "typescript": "^4.4.4", "yup": "^0.32.11" }, "devDependencies": { "@next/eslint-plugin-next": "^12.0.7", "eslint": "^8.4.0", "eslint-config-next": "^12.0.7", "eslint-config-prettier": "^8.3.0", "prettier": "2.5.1" } }

I got the same issue which I solved by reinstalling the firebase-tool package.我遇到了同样的问题,我通过重新安装 firebase-tool package 解决了这个问题。

npm install -g firebase-tools

I got the same issue.我遇到了同样的问题。 I passed through my index.js.我通过了我的 index.js。 I realized I let a function with no body...我意识到我让一个没有身体的功能......

async function myfunctionName()

I erased it, and it worked much better !我把它擦掉了,效果好多了!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase Function 无法从源加载 function 定义错误解决方案 - Firebase Function Failed to load function definition from source error Solution firebase 云错误无法从源加载 function 定义 - firebase cloud error Failed to load function definition from source Firebase 云功能 - 无法从源加载 function 定义:Restful 端点 - 无法添加定义的端点 - Firebase Cloud functions - Failed to load function definition from source: Restful Endpoints - Failed to add the endpoint defined 我无法部署 firebase 云功能:无法从源加载 function 定义,D:\ 中没有定义“导出”主要内容 - I cannot deploy firebase cloud functions: Failed to load function definition from source, No "exports" main defined in D:\ 无法从 function 源生成清单:TypeError:无法读取未定义的属性(读取“秘密”)反应 js 节点 js - Failed to generate manifest from function source: TypeError: Cannot read properties of undefined (reading 'secret') react js node js 无法从 function 源生成清单:错误:服务帐户 object 必须包含字符串“private_key”属性 - Failed to generate manifest from function source: Error: Service account object must contain a string "private_key" property AWS Amplify:DevTools 无法加载 SourceMap:JSON 中的意外令牌 < position 0 - AWS Amplify: DevTools failed to load SourceMap: Unexpected token < in JSON at position 0 使用 PySpark 从 BigQuery 读取和写入数据:错误 `Failed to find data source: bigquery` - Reading and writing data from BigQuery, using PySpark: ERROR `Failed to find data source: bigquery` ClassNotFoundException:找不到数据源:bigquery - ClassNotFoundException: Failed to find data source: bigquery Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 当试图从 api 路由中的 s3 中提取数据时 - Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 when trying to pull data from s3 in an api route
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM