I’m trying to connect with supabase from Vue.js 3-rd verstion UI. But when I start my project with npm run serve
, I’m getting the following error:
Module not found: Error: Can’t resolve ‘@supabase/supabase.js’ in ‘/Users/alexandr/Documents/Other Projects/Vue3/004/servers/src’
Error tells that it could not find module in .../servers/src
but all modules in node_modules
, which is in main project’s location.
In src
folder only vue components, js-file and css theme.
Here is my code of main vue.js file
<template>
<div class="container">
</div>
</template>
<script>
import { createClient } from '@supabase/supabase.js'
export default {
methods: {
async loadPeople() {
const supabaseUrl = process.env.SUPABASE_URL
const supabaseKey = process.env.SUPABASE_KEY
const supabase = createClient(supabaseUrl, supabaseKey)
console.log('Supabase Objectnn', supabase)
const {data, error} = await supabase.from('Customers').select('*')
if (error) {
console.log(error)
}else{
console.log('datann', data)
}
}
}
}
</script>
<style>
</style>
[email protected]
@vue/cli 5.0.8
@supabase/[email protected]
npm run serve
starts the following cmd vue-cli-service serve
Firstly, I’ve reinstalled subabase like npm install @supabase/supabase-js
instead of ‘npm install supabase’. But it did not helped.
I can’t understand why js searching module in src instead of Project/node_modules?