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

Error importing file from systemjs text plugin #21

Closed
bnavetta opened this issue May 22, 2015 · 3 comments
Closed

Error importing file from systemjs text plugin #21

bnavetta opened this issue May 22, 2015 · 3 comments

Comments

@bnavetta
Copy link

When I try to import a text file like this with the SystemJS text loading plugin, I get a compilation error about being unable to resolve an external module.

import html from './app.html!text';

I manually enabled debug logging in the TypeScript plugin and saw this in the console:

TypeScript Cannot find external module './app.html!text'. (TS2307)

It works fine when I don't try to import as a variable (i.e. import from './app.html!text), but then I don't have access to the text.

@frankwallis
Copy link
Owner

Yes, there doesn't seem to be a way to get this past the TypeScript compiler when using import. You will be able to do it using var html = require('./app.html!text') but that is not ideal.

I thought that the allowNonTsExtensions compiler setting might solve this (see #19) but as you say when assigning the result of the import to a variable the compiler still throws this error. It may be worth raising an issue with TypeScript to find out if this is/can be supported.

@bnavetta
Copy link
Author

I also tried TypeScript's amd-dependency directive, but that didn't seem to have any effect either.

@frankwallis
Copy link
Owner

This has already been raised here

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