Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taro开发的支付宝小程序 混入原生支付宝小程序页面后 编译报错 #9471

Closed
Cosen95 opened this issue Jun 7, 2021 · 4 comments
Labels
F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-3 Version - 3.x

Comments

@Cosen95
Copy link

Cosen95 commented Jun 7, 2021

相关平台

支付宝小程序

小程序基础库: 1.24.10
使用框架: React

复现步骤

taro开发的支付宝小程序 里面混入原生的支付宝小程序 编译一直报错
复现链接https://github.com/suneai/alipay-demo

期望结果

编译成功

实际结果

编译 发现页面 src/packageHuabei/pages/rules/index.tsx
⠇ 正在编译...src.replace is not a function

src.replace is not a function

(node:954) UnhandledPromiseRejectionWarning: TypeError: src.replace is not a function
at /Users/sunxiaoye/Desktop/mwee/mwee_mini_2021/node_modules/@tarojs/plugin-platform-alipay/src/index.ts:43:34
at Array.forEach ()
at Object.fn (/Users/sunxiaoye/Desktop/mwee/mwee_mini_2021/node_modules/@tarojs/plugin-platform-alipay/src/index.ts:39:11)
at Kernel. (/Users/sunxiaoye/Desktop/mwee/mwee_mini_2021/node_modules/@tarojs/service/dist/Kernel.js:201:48)
at Generator.next ()
at /Users/sunxiaoye/Desktop/mwee/mwee_mini_2021/node_modules/@tarojs/service/dist/Kernel.js:8:71
at new Promise ()
at __awaiter (/Users/sunxiaoye/Desktop/mwee/mwee_mini_2021/node_modules/@tarojs/service/dist/Kernel.js:4:12)
at /Users/sunxiaoye/Desktop/mwee/mwee_mini_2021/node_modules/@tarojs/service/dist/Kernel.js:200:33
at eval (eval at create (/Users/sunxiaoye/Desktop/mwee/mwee_mini_2021/node_modules/tapable/lib/HookCodeFactory.js:74:10), :14:17)
at new Promise ()
at AsyncSeriesWaterfallHook.eval [as promise] (eval at create (/Users/sunxiaoye/Desktop/mwee/mwee_mini_2021/node_modules/tapable/lib/HookCodeFactory.js:74:10), :2:8)
at AsyncSeriesWaterfallHook.lazyCompileHook (/Users/sunxiaoye/Desktop/mwee/mwee_mini_2021/node_modules/tapable/lib/Hook.js:154:20)
at Kernel. (/Users/sunxiaoye/Desktop/mwee/mwee_mini_2021/node_modules/@tarojs/service/dist/Kernel.js:213:36)
at Generator.next ()
at /Users/sunxiaoye/Desktop/mwee/mwee_mini_2021/node_modules/@tarojs/service/dist/Kernel.js:8:71
(node:954) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:954) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
⠏ 正在编译...

环境信息

▶ taro info
👽 Taro v3.0.9

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

  Taro CLI 3.0.9 environment info:
    System:
      OS: macOS 11.2.3
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 12.16.2 - /usr/local/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 6.14.9 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.1.4 => 3.1.4 
      @tarojs/components: 3.1.4 => 3.1.4 
      @tarojs/mini-runner: 3.1.4 => 3.1.4 
      @tarojs/react: 3.1.4 => 3.1.4 
      @tarojs/runtime: 3.1.4 => 3.1.4 
      @tarojs/taro: 3.1.4 => 3.1.4 
      @tarojs/webpack-runner: 3.1.4 => 3.1.4 
      @tarojs/with-weapp: ^3.2.1 => 3.2.2 
      babel-preset-taro: 3.1.4 => 3.1.4 
      eslint-config-taro: 3.1.4 => 3.1.4 
      react: ^17.0.0 => 17.0.2 
      taro-ui: ^3.0.0-alpha.10 => 3.0.0-alpha.10 
    npmGlobalPackages:
      typescript: 3.9.7
@taro-bot2 taro-bot2 bot added F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-3 Version - 3.x labels Jun 7, 2021
@Cosen95
Copy link
Author

Cosen95 commented Jun 8, 2021

如上,以提供复现demo

@suneai
Copy link

suneai commented Jun 8, 2021

mw@mwdeiMac-2 alipay-demo % taro info
👽 Taro v3.2.10

Taro CLI 3.2.10 environment info:
System:
OS: macOS 11.3.1
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.16.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.11 - /usr/local/bin/npm
npmPackages:
@tarojs/components: 3.2.10 => 3.2.10
@tarojs/mini-runner: 3.2.10 => 3.2.10
@tarojs/react: 3.2.10 => 3.2.10
@tarojs/runtime: 3.2.10 => 3.2.10
@tarojs/taro: 3.2.10 => 3.2.10
@tarojs/webpack-runner: 3.2.10 => 3.2.10
eslint-config-taro: 3.2.10 => 3.2.10
react: ^17.0.0 => 17.0.2

mw@mwdeiMac-2 alipay-demo % npm run dev:alipay

mwee_mini_taro3@1.0.0 dev:alipay /Users/mw/Desktop/other/alipay-demo
npm run build:alipay -- --watch

mwee_mini_taro3@1.0.0 build:alipay /Users/mw/Desktop/other/alipay-demo
taro build --type alipay "--watch"

👽 Taro v3.2.10

Tips: 预览模式生成的文件较大,设置 NODE_ENV 为 production 可以开启压缩。
Example:
$ NODE_ENV=production taro build --type alipay --watch

编译 发现入口 src/app.tsx
编译 发现页面 src/pages/index/index.tsx
编译 发现页面 src/pages/index/native/native.js
⠙ 正在编译...src.replace is not a function

@suneai
Copy link

suneai commented Jun 8, 2021

以上是升级版本以后 还是不可以,好像和版本无关

@Cosen95
Copy link
Author

Cosen95 commented Jun 9, 2021

@luckyadam 可以跟进一下这条issue吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants