Comments (3)
you have to use es6 import... require doesn't work.
from vscode-javascript-repl-docs.
Hey, @airtonix thank you so much for your feedback!
The issue here is not the 'require' but a wrong decision that I made about how the "JS Repl: New Javascript File" it works. More specifically, when users are selecting the "New commands", these new files are temporary files outside of the current workspace folder, and the extension at the moment does not check the workspace folder for already installed node modules.
I am planning to change this, and check automatically the workspace folder for installed modules. If there are more than one workspace folders in vscode, I am thinking to add a window prompt that will ask to select the main folder for this "New repl" command.
Until the next version, if you want to use the already installed modules in your workspace folder you can save a javascript file with your code and try the command "JS Repl: Run" on this file.
Additionally, if you want to require node modules by using the new commands like the "JS Repl: New Javascript File (.js)", you can do what you did and by hovering over the error and click "Install" module, the module will be installed in a temporary folder(after installation the error will be removed).
Thanks again and let me know if you have any other issues.
from vscode-javascript-repl-docs.
@axilleasiv Thanks for that.
I am planning to change this, and check automatically the workspace folder for installed modules. If there are more than one > workspace folders in vscode, I am thinking to add a window prompt that will ask to select the main folder for this "New repl" > command.
sounds reasonable, one suggestion:
- result of the modal question should set workspace settings
.vscode/setttings.json
- modal question shouldn't appear if answer is already in
.vscode/setttings.json
from vscode-javascript-repl-docs.
Related Issues (20)
- How to get the directory where the script is located? HOT 3
- Context menu HOT 3
- [BUG] - Bcrypt not running properly HOT 2
- The URL class anywhere in the input breaks execution HOT 3
- Strict mode "use strict" HOT 7
- Can't seem to make it work as NodeJS REPL inside Gatsby project HOT 3
- extension not working at all (critical error) HOT 20
- React Project Malfunctioning
- Promises is always pending. Can't see value.
- How to set Node.js path manually, the extension can't seem to find node.js in the $PATH but it exists HOT 8
- Error when using imported function, but works well if the imported function actually copied into the source code
- abandoned plugin? HOT 1
- Support XDG config location $XDG_CONFIG_HOME
- What do you think about releasing the code?
- "SyntaxError: Support for the experimental syntax 'classPrivateMethods' isn't currently enabled"
- Doesn't work on vue 3
- Stopped working since December HOT 6
- [BUG]: Nullish coalescing operator broke math operations
- unexpected error
- Doesn't work with typescript
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-javascript-repl-docs.