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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[node-plop] Can't use node-plop inside vscode extension #368

Open
Stun3R opened this issue Feb 18, 2023 · 5 comments
Open

[node-plop] Can't use node-plop inside vscode extension #368

Stun3R opened this issue Feb 18, 2023 · 5 comments

Comments

@Stun3R
Copy link

Stun3R commented Feb 18, 2023

Hi 馃憢馃徏

I'm trying to do a vscode-extension which generate components based on a plopfile.js that I usefor a plop CLI.

As it is mandatory to do it programmatically, I use node-plop but each time I test the extension I get the following error:

require() of ES Module from not supported. Instead change the require of index.js in... to a dynamic import() which is available in all CommonJS modules. with the path pointing to node-plop.

I did some research about it & it looks like as VSCode is based on electron & they don't support ESM package only. microsoft/vscode#130367

Maybe I'm missing something out of the box and would be glad to have your thought on it 馃檹馃徏

@ashish-gawali-adi
Copy link

@Stun3R have you figured a solution to this?

@ashish-gawali-adi
Copy link

@amwmedia would it be possible to know if there a version of node-plop that is CommonJS module and can be used in VSCode extension.

@crutchcorn
Copy link
Member

@ashish-gawali-adi do not tag individual maintainers.

There is no node-plop CJS release.

@ashish-gawali-adi
Copy link

Sorry for that.

Thank you for the answer.

@ebouJ
Copy link

ebouJ commented Apr 26, 2024

jumping on this thread, I am having the issue and it's works fine for 0.26.1 but for any version above I got the same error. Is there any manage change that went in from 0.26.* to the current version 0.32.*?

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

4 participants