Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't compile with commonjs #45

Closed
marc-wilson opened this issue Nov 9, 2018 · 3 comments
Closed

Doesn't compile with commonjs #45

marc-wilson opened this issue Nov 9, 2018 · 3 comments

Comments

@marc-wilson
Copy link

I'm using date-holidays in my angular project. Everything works fine but my unit tests all fail after importing it. It looks like date-holidays won't compile with commonjs module:

Uncaught TypeError: date_holidays_1.default is not a constructor

Here is my tsconig.spec

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/spec",
    "baseUrl": "./",
    "module": "commonjs",  <-- changing so something like "es2015" works fine (but breaks other things not related to date-holdays. I need to keep it as commonjs)
    "types": [
      "jasmine",
      "node"
    ]
  },
  "files": [
    "test.ts",
    "polyfills.ts"
  ],
  "include": [
    "**/*.spec.ts",
    "**/*.d.ts"
  ]
}
@marc-wilson
Copy link
Author

This is the same error message found in #44 but different issue

@johnolos
Copy link
Contributor

I could take a look.

Could you provide a minimalistic repo for me to test out?
As stated in the other issue, for me this works as intended; although I use 'es2015'.

Or even better, if you find the underlying issue, a PR is surely welcome!

@marc-wilson
Copy link
Author

I upgraded to Angular 7 and this issue has gone away. This version comes with some upgrades to some of the testing dependencies angular uses (Karma/Jasmine) which likely fixed itself. This can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants