NG6-starter icon indicating copy to clipboard operation
NG6-starter copied to clipboard

[JSPM] Uncaught ReferenceError: System is not defined

Open EranSch opened this issue 9 years ago • 4 comments

Now that we have successful builds, I'm having an issue actually loading the site from the dist directory. As far as environment, I'm using Node v4.1.1and NPM v3.3.8 along with node-static to host the dist directory.

It looks like there are a chunk of System.register invocations at the bottom of the bundle. The issue here is that System is aliased as $__System everywhere else in the bundle.

image

I messed with this for a while this morning and didn't get anywhere. There are a number of issues that sound similar to this one such as this -- however it documents the problem as being solved.

Being that this is just a starter project, I propose maybe we just do this.

EranSch avatar Oct 19 '15 15:10 EranSch

I had the same issue, update plugin-css to 0.1.17 or higher. https://github.com/systemjs/builder/issues/320

JordanBelford avatar Oct 21 '15 23:10 JordanBelford

Nice, @JordanBelford! This seems to resolve the plugin-css related issues. Oddly, there's a remaining incompatible inclusion that still breaks the build... It appears to be the necolas/normalize.css dependency (line 11981 in the screenshot above).

I haven't had time to try and debug this much further but it's certainly getting closer!

EranSch avatar Oct 23 '15 10:10 EranSch

Had the same issue. After following @JordanBelford advice that issue was resolved. Afterwards I got 'Uncaught ReferenceError: System is not defined'. Including jspm_packages/system.js before build.js in the final index.html is a quick fix.

justinkames avatar Dec 03 '15 07:12 justinkames

Updating both plugin-css and normalize solves this issue partially. In the app.js there is a small hotreload configuration for when you're running the app in localhost. If you want to test your minified/uglyfied code locally you can just comment that code section, for production isn't really a issue.

RafaelTaranto avatar Dec 22 '15 19:12 RafaelTaranto