Skip to content

Instantly share code, notes, and snippets.

@sebdeckers
Last active August 29, 2015 14:20
Show Gist options
  • Save sebdeckers/ce8ca794b8a104c0f28d to your computer and use it in GitHub Desktop.
Save sebdeckers/ce8ca794b8a104c0f28d to your computer and use it in GitHub Desktop.
JSPM error with uri-template-lite
jspm_packages/
node_modules/

Works fine in Node/IOJS

> npm install
> node cjs
< object
< { expand: [Function: expand], Template: [Function: Template] }

Works fine in Babel

> npm install -g babel
> npm install
> babel-node es6
< object
< { expand: [Function: expand], Template: [Function: Template] }

Fails in JSPM

> jspm install
> npm install -g http-server
> http-server
> open "http://127.0.0.1:8080/jspm.html"
< undefined
< undefined
var URI = require('uri-template-lite').URI
console.log(typeof URI)
console.log(URI)
System.config({
"baseURL": "/",
"transpiler": "babel",
"babelOptions": {
"optional": [
"runtime"
]
},
"paths": {
"*": "*.js",
"github:*": "jspm_packages/github/*.js",
"npm:*": "jspm_packages/npm/*.js"
}
});
System.config({
"map": {
"babel": "npm:[email protected]",
"babel-runtime": "npm:[email protected]",
"core-js": "npm:[email protected]",
"uri-template-lite": "npm:[email protected]",
"github:jspm/[email protected]": {
"process": "npm:[email protected]"
},
"npm:[email protected]": {
"process": "github:jspm/[email protected]"
},
"npm:[email protected]": {
"systemjs-json": "github:systemjs/[email protected]"
}
}
});
import {URI} from 'uri-template-lite'
console.log(typeof URI)
console.log(URI)
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
System.import('es6')
</script>
{
"jspm": {
"directories": {},
"dependencies": {
"uri-template-lite": "npm:uri-template-lite@^0.1.11"
},
"devDependencies": {
"babel": "npm:babel-core@^5.1.13",
"babel-runtime": "npm:babel-runtime@^5.1.13",
"core-js": "npm:core-js@^0.9.4"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment