Git Product home page Git Product logo

Comments (3)

airtonix avatar airtonix commented on May 29, 2024

you have to use es6 import... require doesn't work.

from vscode-javascript-repl-docs.

axilleasiv avatar axilleasiv commented on May 29, 2024

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).

image

Thanks again and let me know if you have any other issues.

from vscode-javascript-repl-docs.

airtonix avatar airtonix commented on May 29, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.