LoginRadius / LoginRadius/engineering-blog-samples
Just a question
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 248
- Forks
- 369
- PR merge metrics
- No merged PRs in 30d
Description
```
console.log($);
alert($.capital("hridayesh"))
$.addDOMContent("It works I think!!!")
```
Indeed, that works fine. But I'm wondering, how it would have to look like, if I externalize this functionality into a separate module "index.js" at the "index.html" directory level.
I can't make the import run. Could you elaborate please?
index.js:
```
import capital from './dist/index_bundle.js'
alert(capital("hridayesh"))
```
First attempt:
index.html:
```
```
Browser error:
**Cannot use import statement outside a module**
Second attempt:
index.html:
```
```
Browser error:
**The requested module './dist/index_bundle.js' does not provide an export named 'default'**
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading index.html and index.js alongside dist/index_bundle.js to identify how the bundle exposes its API and why the default import fails. Done should be a documented, reproducible module-loading example with the expected browser behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100