GithubHelp home page GithubHelp logo

Comments (9)

jpoehnelt avatar jpoehnelt commented on June 10, 2024

You likely need to modify your Babel settings for the angular app. The const is only distributed in the es module format and not in the iife or umd outputs.

from v3-utility-library.

nielsbril avatar nielsbril commented on June 10, 2024

@jpoehnelt How can this be done? I'm running into the same problem.

from v3-utility-library.

jpoehnelt avatar jpoehnelt commented on June 10, 2024

How are you building your app? webpack, rollup?

from v3-utility-library.

nielsbril avatar nielsbril commented on June 10, 2024

How are you building your app? webpack, rollup?

Angular 9 using the CLI, so there is no ejected Webpack configuration.

from v3-utility-library.

nielsbril avatar nielsbril commented on June 10, 2024

@jpoehnelt The new release does not fix compatibility with IE11, since the package still uses classes, which are not supported in ES5. I think transpiling the code to ES5 will be the only solution here.

from v3-utility-library.

jpoehnelt avatar jpoehnelt commented on June 10, 2024

Can you share your tsconfig?

from v3-utility-library.

jpoehnelt avatar jpoehnelt commented on June 10, 2024

target
By default, the target is es2015, which is supported only in modern browsers. You can configure the target to es5 to specifically support legacy browsers. Differential loading is also provided by the Angular CLI to support modern, and legacy browsers with separate bundles.

https://angular.io/guide/typescript-configuration#target

You likely need to adjust the target for tsconfig to fully support ie11. I believe that the default is ES2015(ES6) for angular right now.

from v3-utility-library.

nielsbril avatar nielsbril commented on June 10, 2024

My target is set to es5, that is not the problem. The usage of classes in the library gives the error, since the library is not affected by the TypeScript target.

TSConfig:

{
  "compileOnSave": false,
  "compilerOptions": {
    "downlevelIteration": true,
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom",
      "esnext"
    ],
    "module": "es2015",
    "baseUrl": "./"
  }
}

from v3-utility-library.

jpoehnelt avatar jpoehnelt commented on June 10, 2024

The usage of classes in the library gives the error, since the library is not affected by the TypeScript target.

At this point, I would suggest asking this on StackOverflow or similar. Please post back here with the question and your answer.

from v3-utility-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.