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.

Could you please provide instructions for importing

See original GitHub issue

Hi Simon, great library - I just can’t seem to get it working. Since I can’t import from node_modules (there’s nothing in your libs folder) I’ve manually coped your code over to my project, but all attempts to import ‘Selection’ aren’t working for me.

Could you please add further instructions to your docs? This is what I’ve tried (btw I’m new to this):

// import { Selection } from './selection';
// import Selection from './selection';
// import './selection';
// import * from '/selection';
// import '/selection/index.js/';

But I always get “cannot read property ‘create’ of undefined” or similar when I run Selection.create(options).

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
liquidvisualcommented, Jun 3, 2018

I finally fixed it! Woohoo! Your code is perfectly fine, it was an oversight on my end 😃

In the process of setting up my environment, I discovered an awesome online editor (silver lining?) - I’ll share the example with you below. It works great with NPM now. The main issue I was having was due to my html/body being zero height. I completely overlooked it but had to ravage my whole application to find it.

Very excited to move on now, your excellent library is a such an integral part of my application. 👍👍

https://codesandbox.io/s/rlx7w7l76p

Thanks for all the help!

2reactions
Simonwepcommented, Jun 1, 2018

Without node

If you didn’t use node you can use <script src="https://cdn.jsdelivr.net/npm/@simonwep/selection-js@0.0.10/selection.min.js"></script> to include it. Then you can use (in your script file) const selection = Selection.create to create an instance.

With node

With node you can use: const selection = require('@simonwep/selection-js'); If you are using babel you can use: import * as selection from '@simonwep/selection-js';

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tips for New Importers and Exporters
Ask to speak with a CBP import specialist assigned to the commodity you are importing. Import specialists are a valuable resource for commodity ......
Read more >
Documents required for import customs clearance
Since various types of commodities are imported from different countries, a complete list of documents for import customs clearance procedures ...
Read more >
How do I locate the files needed to prepare for importing child ...
Select Instructions for Importing Children (4) to download the Instructions for Importing Children support article. Select Student Import Template (5) to ...
Read more >
Customs clearance instructions for imports – Step 2 - YouTube
This recorded webinar is step 2 of a series of short webinars taking you through the Customs Declaration Service guidance on completing an ......
Read more >
How to import - YouTube
Provides an overview of the introduction of border controls in stages ... You can use social media for help with general queries relating...
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