小编imp*_*tle的帖子

无法在 netlify 上使用 tRPC 构建我的前端应用程序

我正在使用 React Typescript,并且按照tRPC 文档进行服务器/客户端设置,但出现此错误。有谁知道为什么部署时会发生这种情况?我在本地使用的时候效果还好吗?

\n
8:41:46 AM: TS2339: Property \'createClient\' does not exist on type \'"useContext collides with a built-in method, you should rename this router or procedure on your backend" | "Provider collides with a built-in method, you should rename this router or procedure on your backend" | "createClient collides with a built-in method, you should rename this router or procedure on your backend...\'.\n8:41:46 AM:   Property \'createClient\' does not exist on type \'"useContext collides with a built-in …
Run Code Online (Sandbox Code Playgroud)

typescript reactjs trpc.io

6
推荐指数
1
解决办法
2130
查看次数

由于未知的意外令牌“导出”,玩笑测试失败

我将 tRPC 与 Typescript 和 Next.js 结合使用。直到最近我的测试才失败(我认为我没有碰过它们)。我得到了错误Unexpected token 'export'。我尝试过更改我的jest.config.mjs添加transformIgnorePatterns: ["!node_modules/"]以及babel-jest

\n
   transform: {\n      "^.+\\\\.tsx?$": "ts-jest",\n      "^.+\\\\.(js|jsx)$": "babel-jest",\n      "node_modules/variables/.+\\\\.(j|t)sx?$": "babel-jest"\n    },\n
Run Code Online (Sandbox Code Playgroud)\n

但无济于事:(有人可以帮助我吗?这是我的错误日志。

\n
Test suite failed to run\n\n    Jest encountered an unexpected token\n\n    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.\n\n    Out of the box Jest supports Babel, which will be used …
Run Code Online (Sandbox Code Playgroud)

testing commonjs jestjs es6-modules react-testing-library

3
推荐指数
1
解决办法
1610
查看次数