Can't Import supabase in JavaScript - unable to resolve module specifier #31249
Unanswered
TheRog-007
asked this question in
Questions
Replies: 1 comment 5 replies
-
Can you tell us a bit more about your environment and context? What file is this code in? Are you using a bundler? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Trying to use supabase in JavaScript.
installed via terminal using:
npm install @supabase/supabase-js
Copied the example from the API section on the supabase website but the import part does not work:
import { createClient } from "@supabase/supabase-js";
It produces the error:
"unable to resolve module specifier"
Had a fish around and discovered the actual location of @supabase so edited thus:
import { createClient } from "../node_modules/@supabase/supabase-js";
Result - NOTHING no code in the code module is read. Set import location as. ../ as the code module that contains the import command is in a sub folder (./Modules)
Code module is not even being accessed by the browser, how did I determine this? Deleted all code in the module then added:
alert("this runs first";
import { createClient } from "../node_modules/@supabase/supabase-js";
The alert command is NEVER run...??
If I delete the import command everything works..!
Why does the connection example on the supabase website not work? Why does pointing to the location of the @supabase/supabase-js folder result in the module being completely ignored? How is it possible to actually get the import command to work?
Beta Was this translation helpful? Give feedback.
All reactions