Closed josh-sachs closed 7 years ago
Hopefully this has been resolved somehow? I don't think this is an issue with the plugin itself because it definitely does have a translate
method. What is transpiler set to when you debug this?
Still an issue...
"packages": {
...
"plugin-typescript": {
"main": "plugin.js"
},
"typescript": {
"main": "typescript.js",
"meta": {
"typescript.js": {
"exports": "ts"
}
}
}
},
"typescriptOptions": {
"target": "es5",
"module": "es6",
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
"transpiler": "plugin-typescript"
result with 7.0.5/0.20.9
Error: plugin-typescript is not a valid transpiler plugin.
It sounds like you are installing plugin-typescript with npm and not with jspm? It also sounds like systemjs is not correctly interpreting the module type of plugin.js. Try adding format: "register"
to your configuration, ie.
"plugin-typescript": {
"main": "plugin.js",
"format": "register"
},
Correct, I am using npm.
this doesn't seem to help.
"plugin-typescript": {
"main": "plugin.js",
"format": "register"
}
I'm not able to recreate this, I would expect your configuration to look something lie this:
"map": {
"plugin-typescript": "node_modules/plugin-typescript/lib",
"typescript": "node_modules/typescript/lib",
...
}
"packages": {
"plugin-typescript": {
"main": "plugin.js"
},
"typescript": {
"main": "typescript.js",
"meta": {
"typescript.js": {
"exports": "ts"
}
}
}
}
Can you also confirm what is actually being served to the browser when it fetches plugin.js? Otherwise if you could post a repro then I will take a look...
the only difference I could find was that I put plugin.js and typescript.js into the same lib subfolder.
lib
-typescript
--plugin.js
--typescript.js
interestingly enough the browser wasn't pulling down plugin.js - just typescript.js. This is the case in systemjs 19.46 and 20.9. I moved plugin.js into a different folder as such:
lib
-typescript
--typescript.js
-typescript-plugin
--plugin.js
and now plugin.js comes across the wire. This seems to have been the underlying issue... systemjs wasn't even using plugin... the 19 branch just loads typescript.js and it works as the transpiler... version 20 actually does the transpiler check and the typescript.js file fails... In both cases mappings were correct (e.g. I changed the mappings when I changed the folder structure).
I'm not sure why the two packages existing in the same mapped folder is an issue for systemjs - but doesn't seem to be related to the plugin after all.
I'm glad you managed to fix it, what I think is happening is that after mapping plugin-typescript to the typescript directory it will be using the packages configuration for typescript, as that is the name of the directory.
Line 3668 of system.src.js throws an error if transpiler doesn't have a translate property.
Trying to use plugin typescript 6.0.4 + systemjs 0.20.5 isn't working as a result. There is a ticket in systemjs about the "transpier" typo in the Error() already - but that is unrelated.