a***@foxmail.com
a***@foxmail.com
  • 发布:2025-01-13 17:00
  • 更新:2025-01-13 17:00
  • 阅读:12

uni-app 引入 supabase,运行到 android 基座报错

分类:uni-app

在项目中引入了 supabase 作为登录认证。H5页面下运行正常,运行到 android / ios 基座时,报错如下:

报错信息

16:35:03.405 项目 'my-project' 开始编译...  
16:35:16.374 请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。  
16:35:16.384 编译器版本:4.29(vue3)  
16:35:16.396 正在编译中...  
16:35:34.804 ​[@vue/compiler-sfc] `defineProps` is a compiler macro and no longer needs to be imported.  
16:35:34.819 ​  
16:35:34.833 ​[@vue/compiler-sfc] `defineEmits` is a compiler macro and no longer needs to be imported.  
16:35:34.846 ​  
16:35:34.861 ​[@vue/compiler-sfc] `defineExpose` is a compiler macro and no longer needs to be imported.  
16:35:34.875 ​  
16:35:36.091 ​../../../../F:/App/my-project/node_modules/@supabase/auth-js/dist/module/lib/fetch.js (3:14): Error when using sourcemap for reporting an error: Can't resolve original location of error.​  
16:35:36.108 ​../../../../F:/App/my-project/node_modules/@supabase/auth-js/dist/module/lib/fetch.js (3:22): Error when using sourcemap for reporting an error: Can't resolve original location of error.​  
16:35:48.928 Invalid value "iife" for option "output.format" - UMD and IIFE output formats are not supported for code-splitting builds.

supabase 引入方式

import { createClient } from '@supabase/supabase-js';  

const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;  
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY  

export const supabase = createClient(supabaseUrl, supabaseAnonKey);

我猜测需要修改编译配置。但我是第一次使用uni-app,项目使用 HbuilderX 编译运行. 没有找到修改的地方。

希望大佬们看看如何解决这个问题,不胜感激!

2025-01-13 17:00 负责人:无 分享
已邀请:

要回复问题请先登录注册