Cannot use import statement outside a module

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • flanklin
    Junior Member
    • Oct 2022
    • 19

    Cannot use import statement outside a module

    Click image for larger version

Name:	image.png
Views:	149
Size:	19.4 KB
ID:	101610
    Can you help me to explain more about this error and how to fix it. Thank very much​
  • yuri
    Member
    • Mar 2014
    • 8455

    #2
    Likely, your are using ES6 modules in your customization. Use AMD instead.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • flanklin
      Junior Member
      • Oct 2022
      • 19

      #3
      Originally posted by yuri
      Likely, your are using ES6 modules in your customization. Use AMD instead.
      Thank for your reply, yuri

      But, It is module from our partner, that is using ES6. How to use it in our customization module?

      Comment

      • yuri
        Member
        • Mar 2014
        • 8455

        #4
        For new extensions originated from the ext-template, it will ask whether you want to use ES6 modules upon initialization. For existing extensions, currently there's no guideline.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • flanklin
          Junior Member
          • Oct 2022
          • 19

          #5
          Originally posted by yuri
          For new extensions originated from the ext-template, it will ask whether you want to use ES6 modules upon initialization. For existing extensions, currently there's no guideline.
          Thank for you reply yuri

          Click image for larger version

Name:	image.png
Views:	98
Size:	29.4 KB
ID:	101644

          what is content in init js file? can you give a example?

          Comment

          • yuri
            Member
            • Mar 2014
            • 8455

            #6
            I can't give an example. I'm quite busy on daily basis. Please invest some time. Try the ext-template initialization and then see what the file is.
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            Working...