Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. ReferenceError: require is not defined .js
Forum Update on Monday, May 27th 2025

ReferenceError: require is not defined .js

Scheduled Pinned Locked Moved Unsolved Language Bindings
4 Posts 4 Posters 3.1k 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.
  • F Offline
    F Offline
    filipdns
    wrote on 31 Aug 2018, 06:41 last edited by
    #1

    Hello,

    I'm trying to use var fpcalc = require("fpcalc") on my .js in qt creator but I got this error.

    How can I solve that please

    Philippe

    J 1 Reply Last reply 31 Aug 2018, 08:53
    0
    • F filipdns
      31 Aug 2018, 06:41

      Hello,

      I'm trying to use var fpcalc = require("fpcalc") on my .js in qt creator but I got this error.

      How can I solve that please

      Philippe

      J Offline
      J Offline
      JonB
      wrote on 31 Aug 2018, 08:53 last edited by
      #2

      @filipdns
      I presume (don't know) that you need to read e.g. https://brightsign.zendesk.com/hc/en-us/community/posts/115000444494-Javascript-error-require-is-not-defined & https://stackoverflow.com/questions/23603514/javascript-require-function-giving-referenceerror-require-is-not-defined ...

      1 Reply Last reply
      0
      • K Offline
        K Offline
        keksi venksi
        wrote on 27 Aug 2024, 11:20 last edited by
        #3

        @JonB this is not related to JS import requires module .

        The code snippet is correct but when we try to use the other modules using require() code qt provides this error . such that qt have some restriction with QJSEngine .
        We are allowed only to write some base scripts , but we cannot execute all modules of JS in qt JS

        1 Reply Last reply
        0
        • A Offline
          A Offline
          artwaw
          wrote on 28 Aug 2024, 07:50 last edited by
          #4

          6 years later

          you ok, dude?

          For more information please re-read.

          Kind Regards,
          Artur

          1 Reply Last reply
          0

          • Login

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