The debugger extension doesn't work after vsce package, anyone can help me? #250
-
Hi, guys. Did anyone develop a debugger extension? I'm confused about the question for almost two days. The StackOverflow link is here. Link The detail is below. I developed a debug extension which uses an external js debugger adapter. I put the js file to the
And I used it like this in my development environment. {
"label": "ThingIO Debugger",
"program": "./bin/adapter.js",
"runtime": "node",
"type": "thingio-debug"
} The code works well in my development mode, but when I packaged it to a .vsix file and install to another machine, it failed immediately. The webpack file is below //@ts-check
'use strict';
const path = require('path');
//@ts-check
/** @typedef {import('webpack').Configuration} WebpackConfig **/
/** @type WebpackConfig */
const extensionConfig = {
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output: {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path: path.resolve(__dirname, 'dist'),
filename: 'extension.js',
libraryTarget: 'commonjs2'
},
externals: {
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
// modules added here also need to be added in the .vscodeignore file
},
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader'
}
]
}
]
},
devtool: 'nosources-source-map',
infrastructureLogging: {
level: "log", // enables logging required for problem matchers
},
};
module.exports = [ extensionConfig ]; And the I think it looks like the debugger adapter program is not found. So I checked the Now I'm very confused about what wrong is with the extension. Maybe the path is wrong or the webpack did not compile the right file in some situation? Can anyone give some solution or suggestion about this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Are you try-catch and logging errors where debugging starts? Did you check all Outputs in the VS Code where debugging is failing? |
Beta Was this translation helpful? Give feedback.
Are you try-catch and logging errors where debugging starts? Did you check all Outputs in the VS Code where debugging is failing?