Error when trying to use a function from the *.server.js file

alvaroDev
Shopify Partner
1 0 0

I am trying to send the data from a form that I have in my app.jsx to a function within server.js, when I execute the function I get an error saying that it is not a function, I also did a test calling a function with "hello world" with the same result

 

app.admin.jsx

 

import { Test } from '../models/superMark.server';

async function handleSubmit(event) {
  event.preventDefault();

  const test = Test();
  console.log(test);
}

 

 

 

 superMark.server.js

 

export function Test() {
  return "Hello world";
}

 

 

 

And I get app.admin.jsx:64 Uncaught (in promise) TypeError: (0 , import_superMark.Test) is not a function

Replies 0 (0)