I cannot seem to use even simple npm packages in my project.
for example the simple uploader at:
Error i keep getting:
Uncaught ReferenceError: System is not defined
I cannot seem to use even simple npm packages in my project.
for example the simple uploader at:
Error i keep getting:
Uncaught ReferenceError: System is not defined
Do you mean all NPM packages or just this one?
Try to install another one
npm install --save moment
Then add
import * as moment from 'moment';
and use like
console.log(moment().daysInMonth());
Does it work?
Everyone I tried … no in the tutorial.
Seems to be a SystemJs error message.
But the recommened setup uses “commonjs”
What is your Meteor version?
What does your tsconfig.json look like?
{
“compilerOptions”: {
“experimentalDecorators”: true,
“module”: “commonjs”,
“target”: “es5”,
“isolatedModules”: false,
“moduleResolution”: “node”,
“emitDecoratorMetadata”: true,
“removeComments”: false,
“noImplicitAny”: false,
“sourceMap”: true
},
“filesGlob”: [
“client//*.ts",
"server//.ts",
"typings/**/.d.ts”
],
“exclude”: [
“node_modules”
]
}
Did this project start from Meteor 1.2.x and then update to 1.3.x before? Or start from 1.3.x?
No I did the Tutorial Bootstrap just a few days ago.
Just started …trying… adding npm packages.
I do notice these packages have “module”: “commonjs”,
in their tsconfig.json… if that means anything.
I have tried a half a dozen different ones … none work.
Just did…
npm install ng2-imageupload --save moment
consol: 31
What do you mean? Did you succeed?
It output 31 as you would expect. Does the module work? Hmmm,… i’ll see.
Yeah, it means it works. Glad to hear that.
So I guess the issue may be related with ng2-uploader.
Sorry… Does not work.
I tried this one. and example: https://www.npmjs.com/package/ng2-imageupload
Uncaught ReferenceError: System is not defined
If I “just” do…
Then add
import * as moment from ‘moment’;
and use like
console.log(moment().daysInMonth());
it outputs 31 in the browser consol as you would expect.
Because this package does not support common.js either:
Before you use a package, please check how many stars they have on github.
You need make sure the package is in high quality and is maintained actively.
I actually tried to do that for a module?