LoginRadius / LoginRadius/engineering-blog-samples

Just a question

Open
#296 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.