johnsoftek / plugin-jade

Jade loader plugin for jspm
MIT License
13 stars 5 forks source link

Creating a bundle with jspm 0.17 beta does not work #15

Closed jonricaurte closed 8 years ago

jonricaurte commented 8 years ago

Following along here for creating a bundle:

https://github.com/jspm/jspm-cli/blob/master/docs/production-workflows.md#creating-a-bundle

Does not seem to work with plugin-jade.

I get this error:

system.src.js:5031 XMLHttpRequest cannot load file:///Users/name/project/jspm-babel/jspm_packages/npm/jade@1.11.0/lib/runtime.js. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.X @ system.src.js:5031(anonymous function) @ system.src.js:5031(anonymous function) @ system.src.js:5031(anonymous function) @ system.src.js:5031(anonymous function) @ system.src.js:5031(anonymous function) @ system.src.js:5031(anonymous function) @ system.src.js:5031(anonymous function) @ system.src.js:5031(anonymous function) @ system.src.js:5031(anonymous function) @ system.src.js:5031 Error: Error: XHR error loading file:///Users/name/project/jspm-babel/jspm_packages/npm/jade@1.11.0/lib/runtime.js(…)

When I copy the file path, it opens the file fine, so not sure why it isn't working.

Thanks.

johnsoftek commented 8 years ago

Filed as a jspm-cli issue https://github.com/jspm/jspm-cli/issues/1756

jonricaurte commented 8 years ago

@johnsoftek on latest it says cannot read builder of undefined. If systemjs is passing something back as context, this should not be an arrow function:

https://github.com/johnsoftek/plugin-jade/blob/master/jade.js#L28

instead it should be this:

.then(function(loc) {
      if (this.builder) {
        loc = this.getCanonicalName(loc)
      }
      return loc
    })
johnsoftek commented 8 years ago

@jonricaurte I have patched this temporarily in 1.1.1, but I need to investigate further. Will track in #18