在项目中引入了 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 [1m[33m[@vue/compiler-sfc][0m[33m `defineProps` is a compiler macro and no longer needs to be imported.[0m
16:35:34.819
16:35:34.833 [1m[33m[@vue/compiler-sfc][0m[33m `defineEmits` is a compiler macro and no longer needs to be imported.[0m
16:35:34.846
16:35:34.861 [1m[33m[@vue/compiler-sfc][0m[33m `defineExpose` is a compiler macro and no longer needs to be imported.[0m
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 编译运行. 没有找到修改的地方。
希望大佬们看看如何解决这个问题,不胜感激!
0 个回复