Could you please provide instructions for importing
See original GitHub issueHi 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:
 - Created 5 years ago
 - Comments:11 (5 by maintainers)
 
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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!
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.createto 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';