Uploaded image for project: 'VS Code Extension'
  1. VS Code Extension
  2. VSCODE-477

Get "ReferenceError: use is not defined" from template

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      OS: Linux/Ubuntu
      node.js / npm versions: 20.9.0 / 10.1.0

      Additional info:
    • Not Needed

      Problem Statement/Rationale

      When I run the basic playground template, I get `ReferenceError: use is not defined`

      Steps to Reproduce

      1. I connect to my db, hover over the magnifying glass next to Documents, select "Search for documents"

      2. I get this beginning of playground code:
       
      /* global use, db */
      // MongoDB Playground
      // Use Ctrl+Space inside a snippet or a string literal to trigger completions.

      // The current database to use.
      use('tags');
       

      Expected Results

      Code runs with no error.

      Actual Results

       
      [Running] node "/projects/dog_tracking_v2/app/tempCodeRunnerFile.js"
      /data/info/projects/dog_tracking_v2/app/tempCodeRunnerFile.js:6
      use('tags');
      ^

      ReferenceError: use is not defined
      at Object.<anonymous> (/data/info/projects/dog_tracking_v2/app/tempCodeRunnerFile.js:6:1)
      at Module._compile (node:internal/modules/cjs/loader:1241:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
      at Module.load (node:internal/modules/cjs/loader:1091:32)
      at Module._load (node:internal/modules/cjs/loader:938:12)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
      at node:internal/main/run_main_module:23:47

      Node.js v20.9.0

      [Done] exited with code=1 in 0.074 seconds

      Additional Notes

      Any additional information that may be useful to include.

            Assignee:
            sergey.petushkov@mongodb.com Sergey Petushkov
            Reporter:
            gregory.j.bell@gmail.com Greg Bell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: