Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Over-zealous Module Normalization #965

Closed
EisenbergEffect opened this issue Dec 10, 2015 · 4 comments
Closed

Over-zealous Module Normalization #965

EisenbergEffect opened this issue Dec 10, 2015 · 4 comments

Comments

@EisenbergEffect
Copy link

I'm not sure if this is a bug in the TypeScript plugin from Frank Wallis or if it's a bug in system.js. I'm attaching a simple Aurelia solution set up to use TypeScript and Frank's plugin. You can simply unzip the package and view the index.html file in FireFox...or use any web server to serve it. You will see the error in the console as similar to the following:

Error loading file:///Users/EisenbergEffect/Desktop/kit-typescript/src/nav-bar.html.ts!html-resource-plugin

The module name being requested is "file:///Users/EisenbergEffect/Desktop/kit-typescript/src/nav-bar.html!html-resource-plugin" It appears, that when a call to normalizeSync is made against a module id that contains a plugin and a file extension, the package attempts to override the existing file extension with its own.

If this is an error in my configuration, please let me know. It appears to be a bug of some sort though. You should have everything you need to determine the source and solution for the problem in the attached zip.

kit-typescript.zip

@EisenbergEffect
Copy link
Author

Cross referencing the same issue reported for the plugin: frankwallis/plugin-typescript#71

@guybedford
Copy link
Member

@EisenbergEffect thanks, I've fixed this in 0d17b43 and will post a release very soon (hopefully over this weekend).

The workaround would likely be as hinted at in frankwallis/plugin-typescript#71 using a config instead of plugin syntax like:

packages: {
    "app": {
      "main": "app",
      "defaultExtension": "ts",
      "meta": {
        "*.html": {
            "loader": "html-resource-plugin"
        },
        "*.ts": {
          "loader": "ts"
        },
        "*.js": {
          "loader": "ts"
        }
      }
    }

@guybedford
Copy link
Member

(NB the workaround above is actually the preferred method over plugin syntax)

@EisenbergEffect
Copy link
Author

@guybedford I tested out that fix by manually patching up my own system.js version and it works perfectly! Thank you! Please let me know when it is released and we'll get our kits updated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants