XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. ronaldgevern
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Groups 0

    ronaldgevern

    @ronaldgevern

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    ronaldgevern Unfollow Follow

    Latest posts made by ronaldgevern

    • RE: SyntaxError: Cannot use import statement outside a module

      This error can happen in different cases depending on whether you're working with JavaScript on the server-side with Node.js , or client-side in the browser. There are several reasons behind "Cannot use import statement outside a module" error, and the solution depends on how you call the module or script tag.

      Add type="module" inside the script tag

      When working with ECMAScript modules and JavaScript module import statements in the browser, you'll need to explicitly tell the browser that a script is module. To do this, you have to add type="module" onto any ‹script› tags that point to a JavaScript module. Once you do this you can import that module without issues.

      <script type="module" src="./index.js"></script>
      

      If you are working on Node.js or react applications and using import statements instead of require to load the modules, then ensure your package.json has a property "type": "module" as shown below.

      {
        // ...
        "type": "module",
        // ...
      }
      
      posted in Xen Orchestra
      ronaldgevernR
      ronaldgevern