mathiasbynens / mathiasbynens/punycode.js

Using punycode.js as a named module does not work.

Open
#25 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.7k
Forks
170
PR merge metrics
No merged PRs in 30d

Description

Hi,

Having previously configured the paths for require.js, whenever I am trying to use punycode as a named module, it does not seem to be available, until I use

``` js
require(['punycode'],function(punycode){
console.log(punycode);
});
```

The example above works, compared to the one below, that does not

Otherwise, if I am doing something like

``` js
define(['./js/libs/punycode'], function(punycode){
console.log(punycode);
});
```

then it does NOT work.

Cheers,

Alex.

Contributor guide

No contributing guide indexed for this repository

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 reproducing the difference between loading `punycode` through `require(['punycode'], ...)` and loading `./js/libs/punycode` through `define(...)`. Inspect the package's AMD/module entry point and how the configured RequireJS paths resolve each name. Done means the named-module form loads consistently, with a regression test covering the failing example.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.