Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dennis 75 posts 397 karma points MVP
    May 05, 2022 @ 17:19
    Dennis
    0

    Issue converting plugin to typescript with webpack

    Hi, I'm attempting to convert an umbraco plugin to typescript using webpack, but I'm running into an issue.

    When running the website in debug mode, the plugin runs just fine. When I turn debug mode off though, I suddenly get an error when loading my script:

    Uncaught TypeError: Object.defineProperty called on non-object
    at Function.defineProperty (<anonymous>)
    at Function.__webpack_require__.r (script.bundle.js:112:20)
    at eval (index.ts:1:21)
    at Object../frontend/js/index.ts (script.bundle.js:59:1)
    at __webpack_require__ (script.bundle.js:83:41)
    at script.bundle.js:123:37
    at script.bundle.js:125:12
    

    Does anyone know what this error means, where it comes from and/or how to fix it?

    Are there any recommendations when it comes to using typescript when building umbraco plugins?

    I'll gladly provide more details if required.

  • Dennis 75 posts 397 karma points MVP
    May 05, 2022 @ 18:27
    Dennis
    101

    Ok, I was being silly!

    My test website was running in production mode and smidge had been caching my first build, so obviously nothing worked!!

    My first hint was that the exception had the word "webpack" in it, whereas the actual javascript output didn't. After deleting the cache folder, it worked again.

Please Sign in or register to post replies

Write your reply to:

Draft