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 with import library v7 (angular2)

See original GitHub issue

Hi, i have problem when try import library like this import ‘dsmorse-gridster/dist/jquery.gridster.min.js’ In console i have next error:

Can't resolve './jquery.coords.js'
Can't resolve './utils.js'
Can't resolve './jquery.collision.js'
Can't resolve './jquery.draggable.js'

Problem have because in code have part which try add library if current library was imported.

In library part this is next code if (typeof exports === ‘object’) { module.exports = factory(require(‘jquery’), require(‘./jquery.draggable.js’), require(‘./jquery.collision.js’), require(‘./jquery.coords.js’), require(‘./utils.js’)); } Can you fixe it please. This urgent for me 😃 Thks And sorry for my bad english.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Rambutocommented, Mar 22, 2017

I find solution. I copy folder src from github to my project. But this very bad solution. And i want ask you add to npm folder src with all file which you use for library Because all project based on ES6/typescript will try import library which not exist in dist folder.

This list import which code can’t find

  • require(‘./jquery.draggable.js’)
  • require(‘./jquery.collision.js’)
  • require(‘./jquery.coords.js’)
  • require(‘./utils.js’))

Thank you

0reactions
ranran-weiresearchcommented, Apr 27, 2017

I have the same problem!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build error 'Module not found' when importing local library in ...
I have found the error, two simple mistakes: Import statement: This DOES NOT work: import { DiaryShootClientLibService } from ...
Read more >
angular2-polyfills.js gives error when incorporating javascript ...
It's a weird problem: I seem to be able to build and run when there is only 1 line of code from the...
Read more >
Creating libraries - Angular
Anything exported from this file is made public when your library is imported into an application. Use an NgModule to expose services and...
Read more >
Making your Angular 2 library statically analyzable for AoT
Note: This error only appears when using the library in an app that is compiled with the angular cli. (Not when using ngc...
Read more >
Angular 2 Errors - Dave Ceddia
From Igor: This is a problem with polyfilling ES Modules. Something outside of Angular, and in fact a well known issue with all...
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