Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED] qbs: Error while executing JavaScriptCommand: ReferenceError: Can't find variable: TextFile
Forum Update on Monday, May 27th 2025

[SOLVED] qbs: Error while executing JavaScriptCommand: ReferenceError: Can't find variable: TextFile

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 1 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    t.j.a.devries
    wrote on 8 Aug 2013, 12:47 last edited by
    #1

    I have something like this in my qbs module file
    @
    Rule {
    ...
    prepare: {
    var cmd = new JavaScriptCommand();
    cmd.sourceCode = function() {
    var file = new TextFile(output.fileName, TextFile.WriteOnly);
    file.close();
    }
    return cmd;
    }
    }
    @
    I think it worked before, now during building I get
    "Error while executing JavaScriptCommand: ReferenceError: Can't find variable: TextFile".
    Opening for reading has the same effect. What's wrong?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      t.j.a.devries
      wrote on 12 Aug 2013, 15:18 last edited by
      #2

      Replying to my own question... This is the helpful answer I received in the qtcreator list:

      "The right place to ask this question is the qbs mailing list; see
      http://lists.qt-project.org/mailman/listinfo/qbs.
      Your problem is probably solved by importing qbs.TextFile at the top of
      your project file. This requirement was recently introduced for
      consistency. Similarly, the other import statement should now read
      "import qbs.FileInfo".

      Christian"

      1 Reply Last reply
      0

      1/2

      8 Aug 2013, 12:47

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved