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.

problem using generator-angular2-library to import non-Angular dependencies (FullCalendar.io)

See original GitHub issue

I have used generator-angular2-library to create a component to wrap and use FullCalendar http://fullcalender.io for Angular 4 projects, but found I cannot include and package the FullCalendar libraries properly within the generator-angular2-library generated component. The end result is that using in final application (like the one created from angular-cli), the component within the app cannot load reference to FullCalendar.io.

I have created 2 demos, one is the component itself created by generator-angular2-library, fullcalendar-ag4 https://github.com/kktam/fullcalendar-ag4. This is published in npm https://www.npmjs.com/package/fullcalendar-ag4.

The demo applicaton that consumes fullcalendar-ag4, is fullcalendar-app-ag4, https://github.com/kktam/fullcalendar-app-ag4.

Aftering installing and runnning

npm i
ng serve

Then the following error occurs during ng serve.

$ ng serve
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200 **
Hash: fdfb486dd1a1fc9bf051                                                              
Time: 33871ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 5.41 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.18 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

ERROR in ./~/fullcalendar-ag4/index.js
Module not found: Error: Can't resolve 'fullcalendar/index' in '/Users/user/Documents/Work/angular2/fullcalendar-app-ag4/node_modules/fullcalendar-ag4'
 @ ./~/fullcalendar-ag4/index.js 5:0-28
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

I have checked another example https://github.com/lbertenasco/ap-ng2-fullcalendar that uses hand crafted bundling method, and it fullcalendar is packaged correctly. Your help is most appreciated.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:25 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
jvandemocommented, Jul 22, 2017

@BenevidesLecontes — Thank you, really appreciate your help!

@kktam — Thank you for your follow-up 👍

1reaction
jvandemocommented, Jul 21, 2017

@BenevidesLecontes — Thank you for your help, much appreciated! 👍

@kktam — Can you let us know if you got it working? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a step-by-step guide for creating Angular 4 packages ...
Following issue 159. It would be beneficial to create step by step to cover how to import non angular dependencies and provide a ......
Read more >
Angular Component - Docs - FullCalendar
The first step is to install the FullCalendar-related dependencies. You'll need FullCalendar core, the Angular adapter, and any plugins you plan to use:....
Read more >
V4 Release Notes and Upgrade Guide - Docs v4 - FullCalendar
It sheds a number of outdated dependencies and offers a more modern API. ... removed as a dependency and thus there is no...
Read more >
V6 Release Notes and Upgrade Guide - Docs - FullCalendar
DX: FullCalendar no longer attempts to import .css files. Instead, FullCalendar's JS is responsible for injecting its own CSS.
Read more >
Getting Started - Docs - FullCalendar
The simplest way to get started is with FullCalendar's pre-built bundles and <script> tags: Initializing with script tags. For larger projects, it's best...
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