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

I can't use modules #859

Closed
coolCucumber-cat opened this issue May 1, 2023 · 7 comments
Closed

I can't use modules #859

coolCucumber-cat opened this issue May 1, 2023 · 7 comments

Comments

@coolCucumber-cat
Copy link

I have to import with require and export with module.exports. I've tried changing the file extension to .mjs, in the package.json and changing the type to module but it doesn't work. Maybe in jsconfig I can do something? I have to use modules and I also hate the look of the word require.

@mjbvz
Copy link
Collaborator

mjbvz commented May 1, 2023

See microsoft/vscode#130367

@mjbvz mjbvz closed this as completed May 1, 2023
@coolCucumber-cat
Copy link
Author

See microsoft/vscode#130367

It's been almost 2 years and it still hasn't been resolved. Isn't it like one line of code where it's doing require instead of import?

@igorskyflyer
Copy link

See microsoft/vscode#130367

It's been almost 2 years and it still hasn't been resolved. Isn't it like one line of code where it's doing require instead of import?

No, actually, it's a huge change...

@coolCucumber-cat
Copy link
Author

See microsoft/vscode#130367

It's been almost 2 years and it still hasn't been resolved. Isn't it like one line of code where it's doing require instead of import?

No, actually, it's a huge change...

What is it then?

@coolCucumber-cat
Copy link
Author

See microsoft/vscode#130367

It's been almost 2 years and it still hasn't been resolved. Isn't it like one line of code where it's doing require instead of import?

No, actually, it's a huge change...

Also you realise it really doesn't help until everything works. Weakest link in the chain.

@coolCucumber-cat
Copy link
Author

What's the change though? It doesn't seem like it would be a big thing, it's just importing something. Can't you just replace require with await import? I don't understand because my problem is not being able to import so why are changes needed other than how you import?

@coolCucumber-cat
Copy link
Author

See microsoft/vscode#130367

It's been almost 2 years and it still hasn't been resolved. Isn't it like one line of code where it's doing require instead of import?

No, actually, it's a huge change...

Also you realise it really doesn't help until everything works. Weakest link in the chain.

Does everything need to be updated to ES6, or what? Also ES modules have been around for 8 years. The time between CJS require and ES modules is greater than the time between ES modules and now. Why wasn't this done 8 years ago?

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

3 participants