Naeem Sarfraz
Naeem Sarfraz

Reputation: 7430

Importing an ES6 module using jspm & using in Aurelia

I'm trying to use the querystring package in an Aurelia application but getting Cannot read property 'stringify' of undefined error in the browser console.

These are the steps I took:

What step am I missing?

Upvotes: 0

Views: 325

Answers (1)

Fabio
Fabio

Reputation: 11990

First, jspm install querystring will not install the library that you have mentioned. The command that you should run is this:

jspm install npm:qs

Then, you can import and use it like this:

import querystring from 'qs';
// call querystring.stringify(someObject);

Or

import {stringify} from 'qs';
// call stringify(someObject);

Upvotes: 3

Related Questions