Having trouble launching the Nuxt 3 development server because the module '@volar/typescript/lib/node/proxyCreateProgram' cannot be located

Whenever I attempt to execute npm run dev, the dev server initiates but encounters the following error:

Cannot start nuxt:  Cannot find module '@volar/typescript/lib/node/proxyCreateProgram
Require stack:
  - node_modules\vite-plugin-checker\dist\esm\checkers\vueTsc\prepareVueTsc.js

I have tried installing @volar and vite-plugin-checker as dependencies, yet the server still fails to run. Could it be that I am missing a dependency or misconfiguring something in my project? My setup includes Vue 3 with Nuxt 3 library, and I aim to perform type checking on my code upon server startup, although I acknowledge the impact on performance. Despite installing vue-tsc@^1 and typescript (as per the documentation here: https://nuxt.com/docs/guide/concepts/typescript), the server remains unable to run.

Below is a snippet from my nuxt.config.ts:

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: '2024-04-03',
  devtools: { enabled: true },
  ssr: false,

  // Global page headers: https://go.nuxtjs.dev/config-head
  app: {
    head: {
      title: "customer-portal-frontend",
      meta: [
        { charset: "utf-8" },
        { name: "viewport", content: "width=device-width, initial-scale=1" },
        { hid: "description", name: "description", content: "" },
        { name: "format-detection", content: "telephone=no" },
      ],
      link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
    },
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
    "@/assets/css/main.scss",
  ],

  
  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  [
  "@nuxtjs/i18n",
    {
      defaultLocale: "en",
      locales: [
        {
          code: "en",
          file: "en-US.js",
          name: "English",
        },
        {
          code: "es",
          file: "es-ES.js",
          name: "Español",
        },
        {
          code: "fr",
          file: "fr-FR.js",
          name: "Français",
        },
      ],
      lazy: true,
      langDir: "lang/",
      strategy: "no_prefix",
    },
  ], 
  "nuxt-auth-utils", "@pinia/nuxt"],

  runtimeConfig: {
    public: {
      baseURL: process.env.BASE_URL || "http://localhost:3012/",
    },
    app: {
      baseURL: process.env.BASE_URL || "http://localhost:3012/"
    }
  },
  

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
  
  },
  postcss: {
    plugins: {
      tailwindcss: {},
      autoprefixer: {},
    },
  },

  typescript: {
    typeCheck: true
  },
  
})

Answer №1

When dealing with the latest Nuxt version, it's crucial to pay attention to nested dependencies like @volar/typescript. The error messages may not directly point to them, but addressing these dependencies can help get rid of the root cause.

In the current Nuxt version (3.12.4), the correct installation requires using vue-tsc@2. Attempting to install vue-tsc@1 triggers a warning that sheds light on the issue at hand:

ERESOLVE overriding peer dependency
While resolving: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c7b1aeb3a2eab7abb2a0aea9eaa4afa2a4aca2b587f7e9f0e9f5">[email protected]</a>
Found: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2a5c5f4f075e59496a1b041204181d">[email protected]</a>
node_modules/vue-tsc
  dev vue-tsc@"1" from the root project

Could not resolve dependency:
peerOptional vue-tsc@">=2.0.0" from <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f3859a8796de839f86994c8994909c9991898cbecebdcd00">[email protected]</a>
node_modules/vite-plugin-checker
  vite-plugin-checker@"^0.7.2" from @nuxt/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0a7c637e6f27687f65686363547836141f881314">[email protected]</a>
  node_modules/@nuxt/vite-builder

Conflicting peer dependency: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ddaba8b8f0a9aebe9deff3edf3efe4">[email protected]</a>
node_modules/vue-tsc
  peerOptional vue-tsc@">=2.0.0" from <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f6809f8293db869a8388988f85d39394949">[email protected]</a>
  node_modules/vite-plugin-checker
    vite-plugin-checker@"^0.7.2" from @nuxt/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5e28372a3b733c2b37323a3b2c1e6d706f6c70">[email protected]</a>
    node_modules/@nuxt/vite-builder

If you're facing similar issues, check out the documentation here, and make sure to run the following command for proper setup:

npm i -D vue-tsc typescript

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Invoke a handler from one function within another function

I am unsure of the best approach for achieving this, or if it is even feasible, but I have two components: a main navigation bar (NavBar) that spans across the top of the page, and a sidebar drawer. NavBar: export default function NavBar() { const c ...

What benefits does JavaScript offer with the strategy of storing functions within variables?

Lately I've come across some code where functions are being stored inside variables and then called in the typical way. For example: var myFunctionName = function() { Code Here... } myFunctionName(); I'm aware that there may be numerous b ...

Are there any downsides to utilizing the jQuery Load function?

I am in the process of creating a website that displays sensor data. I plan to incorporate a HighChart line chart to showcase this data. Since my website is relatively simple in terms of content, I have decided to consolidate all elements onto one page inc ...

Retrieve the prior position using the AngularJS ui-router

Utilizing fromState and fromParams within the $stateChangeSuccess event allows us to access all details regarding the previous location. This concept is elaborated in the following discussion: Angular - ui-router get previous state $rootScope.$on('$s ...

It appears that the query parameters are impacting the speed at which the page loads

I am currently developing a project on this platform. It is using c9.io, an innovative browser-based collaborative programming IDE. The index.php file includes the following script: <?php $path = ltrim($_SERVER['REQUEST_URI'], '/&ap ...

Tips for creating a textarea element that resembles regular text format

I am working on creating an HTML list that allows users to edit items directly on the page and navigate through them using familiar keystrokes and features found in word processing applications. I envision something similar to the functionality of To achi ...

Is there a way for me to prevent the setTimeout function from executing?

I have a function that checks the status of a JSON file every 8 seconds using setTimeout. Once the status changes to 'success', I want to stop calling the function. Can someone please help me figure out how to do this? I think it involves clearTi ...

Checking the availability of a username by sending an Ajax request every time the user types it may lead to inefficiencies and slower response times. Are there

I have developed a NodeJS authentication application. In this scenario, when a user enters a username, the system will display "username taken" if it is already in use, otherwise it will show "username available". I am interested in understanding the lim ...

In Vue.js2, you can easily compare two arrays of objects that have the same values and then make changes or add properties from one array to the other

I am working with an array of objects fetched from an API (), which is linked to a variable that serves as the v-model for an input. Whenever the variable changes, so does the array through a function that triggers the API call on @keyup. The structure of ...

Trouble with reading from a newly generated file in a node.js program

Whenever I launch my results.html page, I generate a new JSON file and use express.static to allow access to the public folder files in the browser. Although my application is functioning properly, I find myself having to click the button multiple times f ...

Customizing content based on Route - Utilizing Node.js/React

I am currently working on setting up routes for different pages of store profiles in my Node app. I have been doing some research online and have come to understand how to adjust the parameters, but I am struggling with figuring out how to dynamically chan ...

Facing issues with Express, http-proxy-middleware, and encountering the error net::ERR_CONNECTION_REFUSED

For some time now, I've been troubleshooting an issue with my Express App that utilizes http-proxy-middleware to forward requests to another backend service. The problem arises when a third-party application makes a request to my server using an IP ad ...

Why is my "webpack" version "^5.70.0" having trouble processing jpg files?

Having trouble loading a jpg file on the Homepage of my app: import cad from './CAD/untitled.106.jpg' Encountering this error message repeatedly: assets by status 2 MiB [cached] 1 asset cached modules 2.41 MiB (javascript) 937 bytes (rjavascript ...

Encountering an issue in Vue where trying to set focus to a button results in the error "Cannot read property 'focus' of

I am a beginner with Vue and I have a component that triggers my generic 'Error' modal when the endpoint fails. Everything is working fine, but I am encountering the following error: Cannot read property 'focus' of undefined This erro ...

What is the process of declaring variables within VueJS directives that have been custom-built?

When attempting to declare a variable in the usual way, I encountered an error: Vue.directive('my-directive', { varA: '', inserted: function(el, binding, vnode){ this.varA = 'test'; // Error: ...

Switching between vertical and horizontal div layouts while reorganizing text fields within the top div

function toggleDivs() { var container = document.querySelector(".container"); var top = document.querySelector(".top"); var bottom = document.querySelector(".bottom"); if (container.style.flexDirection === "column") { container.style.flexDirec ...

What is the best way to save JSON data within HTML elements?

I want to enhance my FAQ by making it easily editable. Currently, the content can only be edited in the HTML file. I am looking to load all the information from a JSON file so that any changes or additions to questions and answers can be made directly in t ...

Utilizing Ajax to dynamically generate unique ID's for multiple checkboxes

I have been working on a website that is almost completed, however, I have come across a new task where I need to select check-boxes in order to archive news items or "blog posts". The concept is to have a check-box next to each blog post and by checking ...

Adding style using CSS to a dynamically generated table row in Vue.js

Currently, I am working with a table that dynamically generates rows using v-for: <table> <tr><th class='name'>Name</th><th>Surname</th></tr> <tr v-for='data in datas'><td class=&a ...

jQuery is working perfectly on every single page, with the exception of just one

Check out my code snippet here: http://jsfiddle.net/9cnGC/11/ <div id="callus"> <div class="def">111-1111</div> <div class="num1">222-2222</div> <div class="num2">333-3333</div> <div class="num3">444-4444< ...