systemjs / plugin-babel

SystemJS Babel Plugin
MIT License
82 stars 33 forks source link

jspm with plugin-babel and react preset: "cannot read property 'transform' of undefined" #9

Closed DavidEwers closed 8 years ago

DavidEwers commented 8 years ago

I'm getting the above error in the Chrome console at system.js 4 @system.src.js:4837 I've got the jsx preset installed in jspm_packages along with the babel-plugin. My config.js has the "transpiler" set as "plugin-babel". My config.js has "presets": [ "react" ] and "blacklist": [] under "babelOptions."

In my "main.js" file I have:

On my index.html I have:

<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
    System.import('/assets/js/main.js');
</script>

I'm not even sure if this is a babel-plugin issue or not. I'm getting the error from system.js, so I logged it there also and under jspm.

DavidEwers commented 8 years ago

I had the config.js "presets" wrong. It should have been "babel-preset-react" to map to the files in the jspm_packages. But now I have a new problem. My server can't find the systemjs-babel-plugin@0.0.2.js. The http file path is totally correct and the file is sitting right there in the correct place.

DavidEwers commented 8 years ago

I tried mapping the 'plugin-babel' and 'systemjs-babel-build' directly to their file paths as suggested in the plugin docs and this didn't work either.

guybedford commented 8 years ago

This plugin is not compatible with jspm 0.16, and only the 0.17 beta release.