Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use yo code to generate a template,and use "Bundle the source code with webpack". when press F5 , it still building,can not launch a extensionHost #239

Closed
KingJch opened this issue Jan 8, 2021 · 11 comments

Comments

@KingJch
Copy link

KingJch commented Jan 8, 2021

No description provided.

@KingJch KingJch changed the title Use yo code to generate Use yo code to generate a template,and use "Bundle the source code with webpack". when press F5 , it still building,can not launch a extensionHost Jan 8, 2021
@barik
Copy link

barik commented Jan 16, 2021

More precisely, within vscode when doing Run Extension it executes:

yarn run v1.22.5
warning package.json: No license field
$ webpack --watch --config ./build/node-extension.webpack.config.js
asset extension.js 2.92 KiB [compared for emit] (name: main) 1 related asset
./src/extension.ts 1.43 KiB [built] [code generated]
external "vscode" 42 bytes [built] [code generated]
webpack 5.15.0 compiled successfully in 1836 ms

but then does not actually open the VS Code Extension Development Host.

@barik
Copy link

barik commented Jan 16, 2021

Should it be npm:test-compile in launch.json for "preLaunchTask"?

@tomchen
Copy link

tomchen commented Jan 16, 2021

Yeah. Same problem here.

I guess tsl-problem-matcher is incompatible with webpack 5 (eamodio/vscode-tsl-problem-matcher#4, eamodio/vscode-tsl-problem-matcher#5).

As a temporary solution, you could:

in .vscode/tasks.json, change

"problemMatcher": [
	"$ts-webpack-watch",
	"$tslint-webpack-watch"
],

to

"problemMatcher": "$tsc-watch",

in package.json, change

"watch": "webpack --watch --config ./build/node-extension.webpack.config.js",

to

"watch": "tsc -watch -p ./",

Now the scripts watch and test-watch do exactly the same thing. So, if you want, you could also get rid of one of them completely and use the other one.

@aeschli
Copy link
Contributor

aeschli commented Jan 29, 2021

I see the same.
Webpack finishes with message:
webpack 5.18.0 compiled successfully in 1619 ms

@eamodio Can you help by updating the extension? PR eamodio/vscode-tsl-problem-matcher#5 is there but it seem the pattern needs to be improved further

@eamodio
Copy link
Contributor

eamodio commented Jan 29, 2021

I've been holding off on further updates because of this discussion webpack/webpack-cli#2374. But I'll see what I can do with the messages we have now.

@FuPeiJiang
Copy link

for the time being, use webpack-cli@4.2.0
or
in node-extension.webpack.config.js

  infrastructureLogging: {
    level: 'log',
  },

refs: webpack/webpack-cli#2206 (comment)
https://webpack.js.org/configuration/other-options/#infrastructurelogging

@aeschli
Copy link
Contributor

aeschli commented Feb 26, 2021

@eamodio Any updates? I can't leave it broken...

@eamodio
Copy link
Contributor

eamodio commented Feb 26, 2021

Will get it fixed today, though with webpack cli later than 4.2 you'll need a flag (until I can get changes landed)

@eamodio
Copy link
Contributor

eamodio commented Mar 1, 2021

@aeschli I published a new version of the problem matchers (0.4.0). Although with webpack-cli > 4.2 we'll need to add this to the webpack.config.js to get it work properly.

 infrastructureLogging: {
    level: 'log',
  },`

Although, even with that change, I see the problem matcher match error, but I am not seeing F5 being blocked. But I don't think that is because of the matcher -- I feel like it has to do with the terminal changes & tasks.

I will talk to @Tyriar tomorrow about it.

@aeschli
Copy link
Contributor

aeschli commented Mar 26, 2021

Thanks @eamodio, the new version works!

@aeschli aeschli closed this as completed Mar 26, 2021
@felipecrs
Copy link
Contributor

felipecrs commented Sep 8, 2021

I believe that eamodio/vscode-tsl-problem-matcher#9 solves the remaining issue, which was that errors or success would not get caught during a re-compilation as shown at eamodio/vscode-tsl-problem-matcher#9 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants