#Astro extension keeps crashing

7 messages · Page 1 of 1 (latest)

fallow hull
#

The Astro extension for VSCode keeps crashing, will installing the "astrojs/ts-plugin" and adding it to my tsconfig give me intellisense in case the exntension crashes?

sharp crowBOT
#

Hi @fallow hull. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The @astrojs/ts-plugin is designed to support importing .astro files from .ts files, which can be useful for re-exporting. However, it's not explicitly stated in the provided extracts that this plugin will provide IntelliSense features in the event of the Astro VSCode extension crashing.

To install the @astrojs/ts-plugin, you can use one of the following commands based on your package manager:

For npm:

npm install @astrojs/ts-plugin

For pnpm:

pnpm install @astrojs/ts-plugin

For Yarn:

yarn add @astrojs/ts-plugin

After installing the plugin, you can add it to your tsconfig.json as follows:

"compilerOptions": { 
  "plugins": [ 
    { "name": "@astrojs/ts-plugin" }, 
  ], 
}

Remember, this plugin is primarily for supporting the import of .astro files from .ts files and may not provide the full IntelliSense features that the Astro VSCode extension offers. If you're experiencing crashes with the Astro VSCode extension, it might be worth reporting the issue on the Astro GitHub page or checking there for potential solutions.

Sources:


Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@fallow hull kapa.ai is still learning and improving, please let us know how it did by reacting below

static quiver
#

No, @astrojs/ts-plugin is only for getting certain features to work in .ts files

#

Do you get an error message related to the crashes?

fallow hull
#

I'll paste more if I get it again, for now I only have the output of a terminal that ran the dev server:

file:///home/mordi/Projects/mom-recipe-archive/node_modules/vite/dist/node/chunks/dep-df561101.js:43799
    const err = new Error('The server is being restarted or closed. Request is outdated');
                ^

Error: The server is being restarted or closed. Request is outdated
    at throwClosedServerError (file:///home/mordi/Projects/mom-recipe-archive/node_modules/vite/dist/node/chunks/dep-df561101.js:43799:17)
    at Object.resolveId (file:///home/mordi/Projects/mom-recipe-archive/node_modules/vite/dist/node/chunks/dep-df561101.js:44197:21)
    at ModuleGraph.resolveId (file:///home/mordi/Projects/mom-recipe-archive/node_modules/vite/dist/node/chunks/dep-df561101.js:64978:65)
    at ModuleGraph._resolveUrl (file:///home/mordi/Projects/mom-recipe-archive/node_modules/vite/dist/node/chunks/dep-df561101.js:64938:57)
    at ModuleGraph.getModuleByUrl (file:///home/mordi/Projects/mom-recipe-archive/node_modules/vite/dist/node/chunks/dep-df561101.js:64716:34)
    at FSWatcher.<anonymous> (file:///home/mordi/Projects/mom-recipe-archive/node_modules/astro/dist/content/vite-plugin-content-imports.js:106:58) {
  code: 'ERR_CLOSED_SERVER'
}

Node.js v20.5.1