piotrwitek / react-redux-typescript-jspm-starter

Futuristic, bundle-free, development environment for building Component-Driven SPA with React, Redux and TypeScript - powered by JSPM (SystemJS & Rollup with tree-shaking)
https://piotrwitek.github.io/react-redux-typescript-jspm-starter/
MIT License
231 stars 43 forks source link

Error: Cannot read property 'System' of undefined #38

Closed maxali closed 7 years ago

maxali commented 7 years ago

I am getting Cannot read property 'System' of undefined whenever I try to npm start. I clone the package again and still getting this error.

image

piotrwitek commented 7 years ago

From description it seems like a missing System.js dependency

I'm guessing, did you execute all the installation process steps? In particular these: npm install & npm run init?

rvangsgaard commented 7 years ago

I am getting the exact same error. I did run the commands in the correct order.

At first run I did not have Global JSPM installed, if that should make a difference.

piotrwitek commented 7 years ago

Cool, thanks for reporting, I will get a clean clone and try to reproduce on my machine. Btw. what OS are you using?

rvangsgaard commented 7 years ago

Originally I used MacOS X. I just tried from Ubuntu 16.04 with the same results - and this time I did install JSPM before anything else :)

JulianIsrael commented 7 years ago

I'm getting same issue.

JulianIsrael commented 7 years ago

I have another version of the same project, when I installed it at first it was using SystemJS v0.19.41 and the problem came when it suddenly started to use SystemJS v0.20.4 Dev. Check the system.js file within jspm_packages.

rvangsgaard commented 7 years ago

My system.js is v0.20.4 Dev as well. Can I force it to use v0.19.41?

rvangsgaard commented 7 years ago

It did not help to use system.js 0.19.32 in my case.

JulianIsrael commented 7 years ago

I copy and paste the systemjs from my other project and it worked. another thing that worked to me was updating the jspm to the latest beta and also the typescript plugin, it would require that you change the code to match the breaking changes like import {poperty} from 'noESModule' to be impor noEsModule from 'noESModule'; noESModule.property;

JulianIsrael commented 7 years ago

I created this issue, https://github.com/jspm/jspm-cli/issues/223, maybe the "^0.17.0-beta.32" because of the ^ is downloading the latest beta. we can try using "0.17.0-beta.32" instead, and see if it works.

update: it seems to work, so by locking the version to be exact "jspm 0.17.0-beta.32" would work. but I suggest you to update it to the latest and fix your imports.

piotrwitek commented 7 years ago

@JulianIsrael you linked a wrong issue, this is correct I believe: https://github.com/jspm/jspm-cli/issues/2233

jcrben commented 7 years ago

@JulianIsrael thanks, pinning jspm in package.json worked: "jspm": "0.17.0-beta.32"

maxali commented 7 years ago

Thanks @JulianIsrael It works with jspm": "0.17.0-beta.32".

@piotrwitek its better to change jspm version to 0.17.0-beta.32 in package.json. It helps new clones i think.

piotrwitek commented 7 years ago

@maxali thanks for investigation and finding out the problem, I gonna do necessary version lock to do a quick fix, but we need to update imports to adhere to breaking changes introduced in SystemJS 0.20 in order to be able to update to new releases (source: http://guybedford.com/systemjs-alignment)

Follow up in: #39