Open zerescas opened 1 month ago
remove code-server and install it using `npm i -g code-server' then try it
instead of creating new issue i am putting this here
if someone using cloud IDE
like Github Codespace
or Gitpod
and unable to use devtool or want to use code-server
IDK if it's correct method or may be not best
but work for me
// https://nuxt.com/docs/api/configuration/nuxt-config
import * as fs from 'node:fs'
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true},
vite: {
server: {
https: {
key: fs.readFileSync('localhost-key.pem'),
cert: fs.readFileSync('localhost-cert.pem')
},
hmr: {
protocol: 'wss',
}
},
},
})
openssl req -new -x509 -key localhost-key.pem -out localhost-cert.pem -days 365 -subj "/CN=localhost"
openssl genrsa -out localhost-key.pem 2048
$ grep -r 'accept-server-license-terms' node_modules/
node_modules/@nuxt/devtools/dist/chunks/vscode.mjs: "--accept-server-license-terms",
node_modules/@nuxt/devtools/dist/chunks/vscode.mjs: "--accept-server-license-terms",
node_modules/@nuxt/devtools/dist/chunks/vscode.mjs: "--accept-server-license-terms",
Comment out flags which are not working
and replace http://localhost:${port}/
with url generate by online ide like
🐛 The bug
There is a section in documentation about VS Code Server, but I can't get working it.
Part 1 - Follow the docs
Installing code-server from coder as proposes the docs leads to an error:
and tab with VS Code freezes with Starting...
Part 2 - Follow the VS Code tab
The tab VS Code has link that leads to the Microsoft website
Installing vscode-server and reloading Nuxt leads to new error:
Also launching code-server from CLI leads to errors:
As I could found, this error tied with replacing code-server with VS Code CLI
🛠️ To reproduce
See "Additional context"
🌈 Expected behavior
Consistent and clear docs about VS Code Server because now next contradict each other:
And in the end nor of these ways working
ℹ️ Additional context
I tried this on:
To reproduce this, just use Nuxt example project
and do steps from 🐛 The bug