question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need Help for integration inside an Aurelia project using Aurelia-CLI

See original GitHub issue

Hello,

I like your library and it use ES6 which is nice to use in my Aurelia project. However, I cannot make it to work inside my project. I include the node_modules/material-datetime-picker/dist/js/datepicker.js in my bundle, but when I try to create a new instance of the dateTimePicker like in your doc :

const picker = new MaterialDateTimePicker();

I get this error : TypeError: _materialDatetimePicker2.default is not a constructor

My project use Babel as transpiler and use the es2015-loose plugin.

Could you help me to integrate this module inside my project? What could be the cause of this problem?

I think that my bundle is correct because I don’t get any error when I’m bundling my files. But the error occurs not on the import, but when I use the new MaterialDateTimePicker() constructor.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
joewscommented, Jan 17, 2017

Thanks for your patience! The old build process had a few problems, which I have resolved. I’ll cut a 2.0.0 release in the next few days. I’ll close this issue when that is released.

The mainentry point file is a UMD file, so it works with CommonJS and AMD (and as a <script> tag).

There is also a module/jsnext:main entry point for tools like rollup that support ES2015 modules directly.

1reaction
Thanoodcommented, Jan 28, 2017

@jwhitfieldseed @Ganbin Works for me! 👍

Aurelia vendor bundle config:

          {
            "name": "rome",
            "path": "../node_modules/rome/dist",
            "main": "rome",
            "resources": [
              "rome.css"
            ]
          },
          {
            "name": "material-datetime-picker",
            "path": "../node_modules/material-datetime-picker/dist",
            "main": "material-datetime-picker",
            "resources": [
              "material-datetime-picker.css"
            ]
          },
          "moment"
Read more comments on GitHub >

github_iconTop Results From Across the Web

Integration of aurelia-syncfusion-bridge with Aurelia CLI
How to integrate aurelia-syncfusion-bridge with Aurelia CLI. ... This Aurelia CLI project uses NPM for package management and RequireJS for loading.
Read more >
Quick Start
Welcome to Aurelia! This quick start guide will take you through creating a Todo app using Aurelia and briefly explain its main concepts....
Read more >
A Installation & set up - Aurelia in Action - liveBook · Manning
Unit and integration testing you project. After you have Node.js installed, you can install the Aurelia CLI globally using the following command: npm...
Read more >
Building your First Aurelia Application - Manning Publications
In addition to generating the project structure, Aurelia CLI commands can be used to execute the build-pipeline steps necessary to transpile and ...
Read more >
Getting Started with Aurelia
Creating an Aurelia application using the CLI is extremely simple. You just need to open a console in the directory where you want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found