NuxtN
Nuxtβ€’16mo agoβ€’
6 replies
Anno

TypeError: Failed to resolve module specifier ".prisma/client/index-browser"

Hey guys,
so im working on my first nuxt.js project and I have been reading and searching for a couple of hours now.

I have a dedicated vps to run this app with the db on it too.

When I start the application using:
npm run dev
everything works perfectly. --> I can load the webpage without any errors in the console or log or anything and all data is present.

When I start the application using:
npm run build 
and
 node ./outputserver/index.mjs
my page is not being loaded properly anymore. and I get this error:
Uncaught TypeError: Failed to resolve module specifier ".prisma/client/index-browser". Relative references must start with either "/", "./", or "../".


but trying the api directly I can access the data. so
/api/guildStats
for example works out perfectly fine. so I know the connection to the database is not the problem.

this is how I try to get the data:
onMounted(async () => {
  try {
    const response = await fetch('/api/guildStats');
    guild.value = await response.json();
  } catch (error) {
    console.error("Error fetching guild data:", error);
  }
});


if I forgot anything or you need to know more specifics please let me know.

Thanks for helping me out!
Was this page helpful?